generated from liutk/owl-admin-base
37 lines
923 B
PHP
37 lines
923 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
// use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
use App\Admin\Services\EmployeeSignService;
|
|
use App\Admin\Services\StoreService;
|
|
use Tests\TestCase;
|
|
|
|
use coordtransform\Helper as CoordinateHelper;
|
|
|
|
class ExampleTest extends TestCase
|
|
{
|
|
/**
|
|
* A basic test example.
|
|
*/
|
|
public function test_the_application_returns_a_successful_response(): void
|
|
{
|
|
// GPS 坐标
|
|
$lon = '106.524698';
|
|
$lat = '29.421605';
|
|
|
|
// 百度接口转换结果
|
|
// $lon = '106.53499612144785';
|
|
// $lat = '29.424741925277104';
|
|
|
|
list($lon, $lat) = CoordinateHelper::wgs84togcj02($lon, $lat);
|
|
list($lon, $lat) = CoordinateHelper::gcj02tobd09($lon, $lat);
|
|
|
|
// BD-09 坐标
|
|
$lon2 = '106.534967';
|
|
$lat2 = '29.424352';
|
|
dump(EmployeeSignService::make()->haversineDistance($lat, $lon, $lat2, $lon2));
|
|
}
|
|
}
|