From cd4854c80bf74633fa98229bc6679243dd27d97b Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Wed, 30 Aug 2023 17:27:05 +0800 Subject: [PATCH] aa --- app/api/logic/VehicleLogic.php | 3 +-- app/common/logic/GpsLogic.php | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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,