|
@@ -314,7 +314,7 @@ class PublicController
|
|
|
['longitude', ''],
|
|
|
], $request, true);
|
|
|
$info = SystemStore::get($id);
|
|
|
- $info['distance'] = sqrt((pow((($latitude - $info['latitude']) * 111000), 2)) + (pow((($longitude - $info['longitude']) * 111000), 2)));
|
|
|
+ $info['distance'] = sqrt((pow((((float)$latitude - (float)$info['latitude']) * 111000), 2)) + (pow((((float)$longitude - (float)$info['longitude']) * 111000), 2)));
|
|
|
//转换单位
|
|
|
$info['range'] = bcdiv($info['distance'], 1000, 1);
|
|
|
return app('json')->successful('ok',compact('info'));
|