This commit is contained in:
unknown 2023-09-02 10:16:23 +08:00
parent 89b5a9eb81
commit a8468a7267

View File

@ -103,6 +103,13 @@ class VehicleLogic extends BaseLogic
$gpsCarHistoryData[$k]['lat'] = $v['latc'];
}
}
if(empty($gpsCarHistoryData)){
//获取车辆状态
$carStatus = (new GpsLogic()) -> status($gpsCarInfo['data']['carId']);
if($carStatus && $gpsCarHistory['code']==1){
$gpsCarHistoryData[] = ['lat'=>$carStatus['data']['carStatus']['latc'],'lon'=>$carStatus['data']['carStatus']['lonc']];
}
}
$data['track_info'] = $gpsCarHistory&&$gpsCarHistory['code']==1 ? $gpsCarHistoryData : [];
//获取车辆使用情况
$travel = (new GpsLogic()) -> mileage($gpsCarInfo['data']['carId'],date('Y-m-d H:i:s',(time() - 604800)),date('Y-m-d').' 23:59:59');