This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$near = "SELECT c.id, c.name, c.email, c.phone, c.logo, c.banner, c.description, cl.lat, cl.lng, | |
ACOS( SIN( RADIANS( cl.lat ) ) * SIN( RADIANS( '$lat' ) ) + COS( RADIANS( cl.lat ) ) | |
* COS( RADIANS( '$lat' )) * COS( RADIANS( cl.lng ) - RADIANS( '$lng' )) ) * 6380 AS distance | |
FROM CLIENT_LOCATION cl | |
INNER JOIN CLIENT c | |
on cl.client_id = c.id | |
WHERE | |
ACOS( SIN( RADIANS( cl.lat ) ) * SIN( RADIANS( ? ) ) + COS( RADIANS( cl.lat ) ) | |
* COS( RADIANS(? )) * COS( RADIANS( cl.lng ) - RADIANS( ? )) ) * 6380 < 10 | |
ORDER BY distance ASC"; |