{
$sPlaceIDs = join(',',$aPlaceIDs);
- $aResultPlaceIDs = array();
+ $aClassPlaceIDs = array();
if (!$aSearch['sOperator'] || $aSearch['sOperator'] == 'name')
{
if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";
$sSQL .= " order by rank_search asc limit $iLimit";
if (CONST_Debug) var_dump($sSQL);
- $aResultPlaceIDs = $oDB->getCol($sSQL);
+ $aClassPlaceIDs = $oDB->getCol($sSQL);
}
if (!$aSearch['sOperator'] || $aSearch['sOperator'] == 'near') // & in
if ($iMaxRank < 9 && $bCacheTable)
{
// Try and get a polygon to search in instead
- $sSQL = "select geometry from placex where place_id in ($sPlaceIDs) and rank_search < $iMaxRank + 5 and st_geometrytype(geometry) in ('ST_Polygon','ST_MultiPolygon') order by rank_search asc limit 1";
- if (CONST_Debug) var_dump($sSQL);
- $sPlaceGeom = $oDB->getOne($sSQL);
+ $sSQL = "select geometry from placex where place_id in ($sPlaceIDs) and rank_search < $iMaxRank + 5 and st_geometrytype(geometry) in ('ST_Polygon','ST_MultiPolygon') order by rank_search asc limit 1";
+ if (CONST_Debug) var_dump($sSQL);
+ $sPlaceGeom = $oDB->getOne($sSQL);
}
if ($sPlaceGeom)
if ($iOffset) $sSQL .= " offset $iOffset";
$sSQL .= " limit $iLimit";
if (CONST_Debug) var_dump($sSQL);
- $aResultPlaceIDs = array_merge($aResultPlaceIDs, $oDB->getCol($sSQL));
+ $aClassPlaceIDs = array_merge($aClassPlaceIDs, $oDB->getCol($sSQL));
}
else
{
if ($iOffset) $sSQL .= " offset $iOffset";
$sSQL .= " limit $iLimit";
if (CONST_Debug) var_dump($sSQL);
- $aResultPlaceIDs = array_merge($aResultPlaceIDs, $oDB->getCol($sSQL));
+ $aClassPlaceIDs = array_merge($aClassPlaceIDs, $oDB->getCol($sSQL));
}
}
}
- $aPlaceIDs = $aResultPlaceIDs;
+ $aPlaceIDs = $aClassPlaceIDs;
}
}
if ($iQueryLoop > 20) break;
}
+
//exit;
if (isset($aResultPlaceIDs) && sizeof($aResultPlaceIDs)) break;
if ($iGroupLoop > 4) break;