diff --git a/app/api/logic/VehicleLogic.php b/app/api/logic/VehicleLogic.php index 4ca3f0a5..f573ab0e 100644 --- a/app/api/logic/VehicleLogic.php +++ b/app/api/logic/VehicleLogic.php @@ -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); //返回数据 diff --git a/app/common/logic/GpsLogic.php b/app/common/logic/GpsLogic.php index 122862b2..cb15db89 100644 --- a/app/common/logic/GpsLogic.php +++ b/app/common/logic/GpsLogic.php @@ -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,