From 91dc1b31c3aa17bc483524289b9a8bce790582ee Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Tue, 17 Oct 2023 17:52:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E8=B5=81=E8=AF=A6=E6=83=85=E4=BC=A0?= =?UTF-8?q?=E5=80=BC=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/VehicleController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/api/controller/VehicleController.php b/app/api/controller/VehicleController.php index a5ea146ce..39557bab8 100644 --- a/app/api/controller/VehicleController.php +++ b/app/api/controller/VehicleController.php @@ -434,8 +434,13 @@ class VehicleController extends BaseApiController //车辆详情 public function vehicleInfo() { + $id = $this->request->get('car_id'); //获取数据 - $data = VehicleRent::where('rent_company_id',$this->userInfo['company_id'])->where('status',2)->findOrEmpty(); + if(!empty($id) && $id != 'undefined'){ + $data = VehicleRent::where('id',$id)->where('status',2)->findOrEmpty(); + }else{ + $data = VehicleRent::where('rent_company_id',$this->userInfo['company_id'])->where('status',2)->findOrEmpty(); + } if($data->isEmpty()){ return $this->fail('数据不存在'); }