From: Steve Sutton Date: Wed, 18 Mar 2015 20:10:51 +0000 (-0400) Subject: Update search sql for the banners X-Git-Tag: v1.2.3^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=9bb083b686f560500a2b7d59b76f543c6dc9709d;p=web%2FMichiganTrailMaps.git 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. --- 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(