Merge pull request '小组公司详情页逻辑修改' (#78) from zhangwei into dev

Reviewed-on: #78
This commit is contained in:
weiz 2023-10-12 17:46:24 +08:00
commit 748dab8948

View File

@ -419,19 +419,10 @@ class VehicleController extends BaseApiController
if($company['company_type'] != 18 ){ if($company['company_type'] != 18 ){
return $this->fail('非小组公司不能访问'); return $this->fail('非小组公司不能访问');
} }
//获取租赁车俩 //获取签约合同
$rentCar = VehicleRent::where('rent_company_id',$company['id'])->where('status',2)->findOrEmpty();
if(!$rentCar->isEmpty()){
$rentCar['mileage'] = 0;
$rentCar['company'] = $company;
$rentCar['contract'] = VehicleContract::field('id,contract_no,contract_url,file,status,create_time')->where('id',$rentCar['contract_id'])->findOrEmpty();
return $this->success('请求成功',$rentCar->toArray());
}else{
$vehicleContract = VehicleContract::where('company_b_id',$company['id'])->where('type','<>',2)->order('id desc')->findOrEmpty(); $vehicleContract = VehicleContract::where('company_b_id',$company['id'])->where('type','<>',2)->order('id desc')->findOrEmpty();
//返回数据
return $this->success('请求成功',$vehicleContract->toArray()); return $this->success('请求成功',$vehicleContract->toArray());
} }
}
//车辆详情 //车辆详情
public function vehicleInfo() { public function vehicleInfo() {