From de5c209399c0c44334174981a64ef6e619131813 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Wed, 12 Jun 2024 15:20:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20app/Http/Controllers/Api/H?= =?UTF-8?q?r/SignController.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/Hr/SignController.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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,