From c6982e7700d9e8fd620a9f5b3e768fb03d915d57 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Mon, 23 May 2011 16:22:25 +0000 Subject: [PATCH] handle 'order state level queries better --- website/search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/search.php b/website/search.php index fc03a58d..afce2ee2 100755 --- a/website/search.php +++ b/website/search.php @@ -898,7 +898,7 @@ // More efficient - can make the range bigger $fRange = 0.05; - $sSQL = "select l.place_id from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." as l"; + $sSQL = "select distinct l.place_id from place_classtype_".$aSearch['sClass']."_".$aSearch['sType']." as l"; if ($sCountryCodesSQL) $sSQL .= " join placex as lp using (place_id)"; if ($sPlaceIDs) { @@ -926,7 +926,7 @@ else { if (isset($aSearch['fRadius']) && $aSearch['fRadius']) $fRange = $aSearch['fRadius']; - $sSQL = "select l.place_id from placex as l,placex as f where "; + $sSQL = "select distinct l.place_id from placex as l,placex as f where "; $sSQL .= "f.place_id in ( $sPlaceIDs) and ST_DWithin(l.geometry, st_centroid(f.geometry), $fRange) "; $sSQL .= "and l.class='".$aSearch['sClass']."' and l.type='".$aSearch['sType']."' "; if (sizeof($aExcludePlaceIDs)) -- 2.39.5