This commit is contained in:
unknown 2023-08-30 17:27:05 +08:00
parent ddb01d4a8f
commit cd4854c80b
2 changed files with 6 additions and 3 deletions

View File

@ -266,9 +266,8 @@ class VehicleLogic extends BaseLogic
$car = Vehicle::where('id',$params['car_id'])->find();
if(empty($car)){
return ['code'=>0,'msg'=>'车辆不存在'];
}else{
$params['gps_car_id'] = $car['gps_carid'];
}
$params['gps_imei'] = $car['gps_imei'];
//获取车辆行驶历史信息
$result = (new GpsLogic()) -> history($params);
//返回数据

View File

@ -67,10 +67,14 @@ class GpsLogic extends BaseLogic
public function history($params):array {
//获取token
$token = $this->token();
$result1 = curl_post($this->domain.'/car/getByImei.do',[],[
'token' => $token,
'imei' => $params['gps_imei'],
]);
//发起请求
$result = curl_post($this->domain.'/position/queryHistory.do',[],[
'token' => $token,
'carId' => $params['gps_car_id'],
'carId' => $result1['data']['carId'],
'startTime' => $params['start_time'],
'endTime' => $params['end_time'],
'filter' => true,