From 8837f44bb449454c8e87cf26ae1451bcfad19510 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Mon, 22 Jan 2018 15:58:22 -0500 Subject: [PATCH] fixing the search queries in the functions file fixing search queries in functions file. --- functions.php | 10 +++++----- glm-member-db/views/front/members/detail.html | 1 - sections/action-container.php | 2 +- sections/interior-page.php | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index a846812..5eba51a 100644 --- a/functions.php +++ b/functions.php @@ -43,7 +43,7 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ) { // listings without the Pre-Owned if ( !isset( $_REQUEST['pre_owned'] ) ) { $queryParts[] = " T.id IN ( - SELECT ref_dest + SELECT entity_id FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_field_data WHERE field_data != 'Yes' AND field_id = (SELECT id @@ -61,7 +61,7 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ) { WHERE field_id = (SELECT id FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_fields WHERE field_name = 'Just Arrived') - AND ref_dest = T.id) "; + AND entity_id = T.id) "; // Order by clause for Red Hot Deal. $orderBy .= ", ( SELECT CASE WHEN field_data = 'Yes' THEN 0 ELSE 1 end @@ -69,7 +69,7 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ) { WHERE field_id = (SELECT id FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_fields WHERE field_name = 'Red Hot Deal') - AND ref_dest = T.id) "; + AND entity_id = T.id) "; // Order by clause for Coming Soon. $orderBy .= ", ( SELECT CASE WHEN field_data = 'Yes' THEN 0 ELSE 1 end @@ -77,7 +77,7 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ) { WHERE field_id = (SELECT id FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_fields WHERE field_name = 'Coming Soon') - AND ref_dest = T.id) "; + AND entity_id = T.id) "; $orderBy .= ", $originalOrderBy DESC "; // Order by clause for Weekly Specials. @@ -87,7 +87,7 @@ add_filter('glm-member-db-front-search-query', function( $queryParts ) { WHERE field_id = (SELECT id FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_fields WHERE field_name = 'Weekly Special') - AND ref_dest = T.id) "; + AND entity_id = T.id) "; $orderBy .= ", $originalOrderBy DESC "; return $orderBy; diff --git a/glm-member-db/views/front/members/detail.html b/glm-member-db/views/front/members/detail.html index 044ccc9..f91ced1 100644 --- a/glm-member-db/views/front/members/detail.html +++ b/glm-member-db/views/front/members/detail.html @@ -155,7 +155,6 @@ {/if} {/foreach} - diff --git a/sections/action-container.php b/sections/action-container.php index e3fba7a..eb00985 100644 --- a/sections/action-container.php +++ b/sections/action-container.php @@ -25,7 +25,7 @@
  • - Homes + Homes
  • Red Hot Deals diff --git a/sections/interior-page.php b/sections/interior-page.php index 2f598a8..9893a2b 100644 --- a/sections/interior-page.php +++ b/sections/interior-page.php @@ -27,7 +27,7 @@ - + $value){ if($value['parent']['value'] === 0){ -- 2.17.1