mercredi 18 janvier 2017

Laravel haversine calculation

I use this tool to calculate distance between 2 points:

$location = new CnpPoi(28.535153, -81.383219);
$destination = new CnpPoi(42.594018, -88.433886)
$location->getDistanceInMilesTo($destination);
$location->getDistanceInMetersTo($destination);

need to use it inside a query to get store ordered by distance from a given point that already have passed trough url his $lat e $long. How i can use this function inside a query?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2k4WW8l
via IFTTT

Aucun commentaire:

Enregistrer un commentaire