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('数据不存在'); }