$sql
=' SELECT userid FROM tbl_myr_refresh
WHERE geohash
IN (:geohash1, :geohash2, :geohash3, geohash4, geohash5, geohash6, geohash7, geohash8, geohash9)';
$geohashCode
=Yii::app()->session[
'geohash'
];
$geohash
=
new
MGeohash();
$neighbors
=
$geohash
->neighbors(
$geohashCode
);
array_push
(
$neighbors
,
$geohashCode
);
$connection
= Yii::app()->db->connection;
$command
=
$connection
->createCommand(
$sql
);
$command
->bindParam(
":geohash1"
,
$neighbors
[0],PDO::PARAM_STR);
$command
->bindParam(
":geohash2"
,
$neighbors
[
'top'
],PDO::PARAM_STR);
$command
->bindParam(
":geohash3"
,
$neighbors
[
'bottom'
],PDO::PARAM_STR);
$command
->bindParam(
":geohash4"
,$
$neighbors
[
'right'
],PDO::PARAM_STR);
$command
->bindParam(
":geohash5"
,
$neighbors
[
'left'
],PDO::PARAM_STR);
$command
->bindParam(
":geohash6"
,
$neighbors
[
'topleft'
],PDO::PARAM_STR);
$command
->bindParam(
":geohash7"
,
$neighbors
[
'topright'
],PDO::PARAM_STR);
$command
->bindParam(
":geohash8"
,
$neighbors
[
'bottomright'
],PDO::PARAM_STR);
$command
->bindParam(
":geohash9"
,
$neighbors
[
'bottomleft'
],PDO::PARAM_STR);
$result
=
$command
->queryAll();
return
$result
;