This commit is contained in:
unknown 2023-09-01 16:58:19 +08:00
parent 6056573305
commit 4361f9ea71

View File

@ -92,18 +92,18 @@ class VehicleLogic extends BaseLogic
$gpsCarHistory = (new GpsLogic()) -> history([ $gpsCarHistory = (new GpsLogic()) -> history([
'gps_car_id' => $gpsCarInfo['data']['carId'], 'gps_car_id' => $gpsCarInfo['data']['carId'],
'start_time' => date('Y-m-d').' 00:00:00', 'start_time' => date('Y-m-d').' 00:00:00',
// 'start_time' =>'2023-08-30 00:00:00',
'end_time' => date('Y-m-d').' 23:59:59' 'end_time' => date('Y-m-d').' 23:59:59'
// 'end_time' => '2023-08-30 23:59:59'
]); ]);
if($gpsCarHistory['code'] == 0){ $gpsCarHistoryData = [];
$data['track_info'] = []; if($gpsCarHistory&&$gpsCarHistory['code']==1){
}else{ foreach($gpsCarHistory['data'] as $k => $v){
$position = []; $gpsCarHistoryData[$k]['lon'] = $v['lonc'];
foreach($gpsCarHistory['data'] as $k=> $v){ $gpsCarHistoryData[$k]['lat'] = $v['latc'];
$position[$k]['latitude'] = $v['latc'];
$position[$k]['longitude'] = $v['lonc'];
} }
$data['track_info'] = $position;
} }
$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'); $travel = (new GpsLogic()) -> mileage($gpsCarInfo['data']['carId'],date('Y-m-d H:i:s',(time() - 604800)),date('Y-m-d').' 23:59:59');
$data['travel_info'] = $travel&&$travel['code'] == 1 ? $travel['data'] : []; $data['travel_info'] = $travel&&$travel['code'] == 1 ? $travel['data'] : [];