Set to use the business_city
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 9 Aug 2018 18:41:00 +0000 (14:41 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 9 Aug 2018 18:41:00 +0000 (14:41 -0400)
Using business_city

models/front/contacts/list.php
setup/frontHooks.php

index 53aa077..fc0ca4b 100644 (file)
@@ -195,7 +195,7 @@ class GlmMembersFront_contacts_list extends GlmDataContacts
         if (isset($_REQUEST['citySearch']) && $_REQUEST['citySearch'] !== "") {
             $citySearch = esc_sql($_REQUEST['citySearch']);
             $where .= " AND (
-                city = $citySearch
+                business_city = $citySearch
             )";
             $haveFilter = true;
         }
index a1baf41..3c7c89b 100644 (file)
@@ -79,9 +79,10 @@ add_filter( 'glm-member-contact-cities', function(){
     $contactCities = $wpdb->get_results(
         "SELECT id, name
            FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "cities
-          WHERE id IN (SELECT city
+          WHERE id IN (SELECT business_city
                          FROM ".GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts
-                        WHERE active = true)
+                        WHERE active = true
+                          AND access NOT IN ( 35, 45, 10, 90 ) )
         ORDER BY name"
     );
     return $contactCities;