我在MySQL
以下查询。
我只想在CakePHP分页条件下转换MySQL查询。这样我就能得到结果。
MySql查询:
SELECT *, 3963 * acos(cos(radians(90-lat ))*cos(radians(90-'".$result['lat']."'))".
"+sin(radians(90-lat ))* sin(radians(90-'".$result['lat']."'))".
"*cos(radians(lng- '".$result['lng']."'))) AS distance FROM member"." HAVING (distance < 5) ORDER BY distance ASC
我正在使用此PHP代码
$condition = array('Member.is_deleted !=' => 1, 'Member.status !=' => 0, 'OR' => array());
$this->paginate = array(
'conditions' => $condition,
'fields' => array()
);