From 9bb083b686f560500a2b7d59b76f543c6dc9709d Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 18 Mar 2015 16:10:51 -0400 Subject: [PATCH] Update search sql for the banners Update sql for the county to be pulled in from city table if the city is given in the search. --- Toolkit/Banners/BannersIterator.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Toolkit/Banners/BannersIterator.php b/Toolkit/Banners/BannersIterator.php index 80ab1f8..555c190 100644 --- a/Toolkit/Banners/BannersIterator.php +++ b/Toolkit/Banners/BannersIterator.php @@ -361,6 +361,12 @@ class Toolkit_Banners_BannersIterator implements IteratorAggregate WHERE county = {$countyId}"; } else { } + } else if ($city = filter_var($_REQUEST['cityId'], FILTER_VALIDATE_INT)) { + $selectBannersAssignedToCounties = " + UNION + SELECT banner + FROM banners2counties + WHERE county = (SELECT county_id FROM city WHERE city_id = {$city})"; } $memberCatsOnPage = $this->_getMemberCatsAvailableOnPage( -- 2.17.1