diff --git a/app/Http/Controllers/Api/Hr/SignController.php b/app/Http/Controllers/Api/Hr/SignController.php index a5351cf..52f0008 100644 --- a/app/Http/Controllers/Api/Hr/SignController.php +++ b/app/Http/Controllers/Api/Hr/SignController.php @@ -80,12 +80,12 @@ class SignController extends Controller $lon = $request->input('lon'); $lat = $request->input('lat'); // 切换坐标系 - // $locationType = $request->input('location_type', 'wgs84'); - // if ($locationType == 'wgs84') { - // $res = wgs84ToGcj02($lat, $lon); - // $lon = $res['lon']; - // $lat = $res['lat']; - // } + $locationType = $request->input('location_type', 'wgs84'); + if ($locationType == 'wgs84') { + $res = wgs84ToGcj02($lat, $lon); + $lon = $res['lon']; + $lat = $res['lat']; + } // 计算距离 $distance = $service->haversineDistance( $lat, @@ -142,12 +142,12 @@ class SignController extends Controller $lon = $request->input('position.lon'); $lat = $request->input('position.lat'); // 切换坐标系 - // $locationType = $request->input('position.location_type', 'wgs84'); - // if ($locationType == 'wgs84') { - // $res = wgs84ToGcj02($lat, $lon); - // $lon = $res['lon']; - // $lat = $res['lat']; - // } + $locationType = $request->input('position.location_type', 'wgs84'); + if ($locationType == 'wgs84') { + $res = wgs84ToGcj02($lat, $lon); + $lon = $res['lon']; + $lat = $res['lat']; + } $distance = $service->haversineDistance( $lat, $lon,