我得到以下方法的空白输出
function getLocation($arr)
{
$data = array();
$qry = $this->db->query('select id,lat,lng from test where lat between'.$arr->lat-0.2 .'and'.$arr->lat+0.2);
$res = $qry->row_array();
if($qry->num_rows()==0)
{
return false;
}
else
{
foreach ($res->result() as $row)
{
$data['distance']=distanceBetween($arr->lat,$arr->lng,$row['lat'],$row['lng']);
$data['id']=$row['id'];
}
return true;
}
}