diff --git a/app/Http/Controllers/Api/Hr/SignController.php b/app/Http/Controllers/Api/Hr/SignController.php index 52f0008..a5351cf 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, diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index fcec800..b700079 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -12,8 +12,6 @@ class ExampleTest extends TestCase */ public function test_the_application_returns_a_successful_response(): void { - $response = $this->get('/'); - - // $response->assertStatus(200); + dump(wgs84ToGcj02('29.421605', '106.524698')); } } diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index 4ba6cdf..5773b0c 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -11,6 +11,6 @@ class ExampleTest extends TestCase */ public function test_that_true_is_true(): void { - dump(round(2.6666, 2, PHP_ROUND_HALF_DOWN)); + $this->assertTrue(true); } }