このクエリを Cakephp に変換したい
SELECT l.* , (
(
(
ACOS( SIN( (
$lat * PI( ) /180 ) ) * SIN( (
l.lat * PI( ) /180 )
) + COS( (
$lat * PI( ) /180 )
) * COS( (
l.lat * PI( ) /180 )
) * COS( (
( $lng - l.long ) * PI( ) /180 )
)
)
) *180 / PI( )
) *60 * 1.1515 * 1.609344
) AS `distance`
FROM hosts l
HAVING `distance` <= 50
ORDER BY `distance` ASC
助けてください.....のようにcontiions配列に追加できればもっと助かります
$this->paginate = array('conditions' => $conditions ,
'order' => array('Host.distance' => 'ASC')
);