更新
This commit is contained in:
parent
86e5d12945
commit
ba65c7c102
@ -179,7 +179,9 @@ class RemoteController extends BaseApiController
|
||||
]);
|
||||
$json=json_decode($res->getContent(),true);
|
||||
$points=$json['data'];
|
||||
|
||||
if(empty($points)){
|
||||
return false;
|
||||
}
|
||||
$target =[
|
||||
"lat"=> $latitude1,
|
||||
"lon"=> $longitude1
|
||||
@ -195,6 +197,7 @@ class RemoteController extends BaseApiController
|
||||
* 计算两点之间的距离
|
||||
*/
|
||||
function getClosestPoint($points, $target) {
|
||||
halt($points,$target);
|
||||
$minDistance = PHP_INT_MAX;
|
||||
$closestPoint = null;
|
||||
foreach ($points as $point) {
|
||||
|
@ -115,12 +115,14 @@ class TaskController extends BaseApiController
|
||||
'end_time'=>$end_time
|
||||
];
|
||||
$data['status'] = 2;
|
||||
Log::error( $parmas);
|
||||
if (isset($parmas['terminus'])) {
|
||||
if( $parmas['terminus']['lnglat'][0]==null || $parmas['terminus']['lnglat'][0]<=0){
|
||||
return $this->fail('定位不存在');
|
||||
}
|
||||
$res = App(RemoteController::class)->coordinate($datas, $parmas['terminus']['lnglat'][0], $parmas['terminus']['lnglat'][1]);
|
||||
if($res==false){
|
||||
return $this->fail('定位不存在|或GPS无轨迹');
|
||||
}
|
||||
$task['extend']['update']['terminus'] = $parmas['terminus'];
|
||||
}
|
||||
if (isset($parmas['transfer'])) {
|
||||
@ -128,6 +130,9 @@ class TaskController extends BaseApiController
|
||||
return $this->fail('定位不存在');
|
||||
}
|
||||
$res = App(RemoteController::class)->coordinate($datas, $parmas['transfer']['lnglat'][0], $parmas['transfer']['lnglat'][1]);
|
||||
if($res==false){
|
||||
return $this->fail('定位不存在|或GPS无轨迹');
|
||||
}
|
||||
$task['extend']['update']['transfer'] = $parmas['transfer'];
|
||||
}
|
||||
if (isset($task['extend']['update']['terminus']) && isset($task['extend']['update']['transfer'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user