租赁详情传值修复

This commit is contained in:
unknown 2023-10-17 17:52:46 +08:00
parent 802b3a91a9
commit 91dc1b31c3

View File

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