From cd9c5ac3a3ca473eb42df81d6416007b38079598 Mon Sep 17 00:00:00 2001 From: unknown <736250432@qq.com> Date: Fri, 1 Sep 2023 13:53:58 +0800 Subject: [PATCH] update --- app/api/controller/VehicleController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/controller/VehicleController.php b/app/api/controller/VehicleController.php index cbe311e6d..d74c70a47 100644 --- a/app/api/controller/VehicleController.php +++ b/app/api/controller/VehicleController.php @@ -317,7 +317,7 @@ class VehicleController extends BaseApiController if($vehicleContract['company_a_id'] != $this->userInfo['company_id']){ return $this->fail('数据不匹配'); } - $vehicleRentCars = VehicleRent::where('company_id',$vehicleContract['company_a_id'])->select()->toArray(); + $vehicleRentCars = VehicleRent::where('company_id',$vehicleContract['company_a_id'])->where('status',0)->select()->toArray(); $data = [ 'vehicleContract' => $vehicleContract->toArray(), 'vehicleRentCars' => $vehicleRentCars @@ -332,13 +332,13 @@ class VehicleController extends BaseApiController if(empty($company)){ return $this->fail('数据错误'); } - if($company['company_type'] !=16 ){ + if($company['company_type'] != 16){ return $this->fail('非镇街公司不能访问'); } //获取小组服务公司申请信息 - $vehicleContract = VehicleContract::where('company_a_id',$company['id'])->where('status','in','-1,0,1,2')->limit(2)->order('create_time desc')->select()->toArray(); + $vehicleContract = VehicleContract::where('company_a_id',$company['id'])->where('status','in','-1,0,1,2')->limit(4)->order('create_time desc')->select()->toArray(); //获取车辆列表 - $vehicleRentCars = VehicleRent::where('company_id',$company['id'])->select()->each(function($item){ + $vehicleRentCars = VehicleRent::where('company_id',$company['id'])->where('status','in','0,1,2')->select()->each(function($item){ if($item['status'] == 2){ $item['rent_user'] = Company::field('company_name,master_name as user_name,master_phone as user_phone,province,city,area,street,village,brigade')->where('id',$item['rent_company_id'])->find()->append(['province_name', 'city_name', 'area_name', 'street_name', 'village_name','brigade_name']); } @@ -346,11 +346,11 @@ class VehicleController extends BaseApiController //获取该公司已签约的小组服务公司数量 $villageCompany = Contract::field('id')->where('party_a',$company['id'])->where('signing_timer',2)->count(); //系统车辆数量 - $rentCar = VehicleRent::field('id')->where('company_id',$company['id'])->where('type',0)->count(); + $rentCar = VehicleRent::field('id')->where('company_id',$company['id'])->where('status','<>', 3)->where('type',0)->count(); //申请中的车辆 $applyCar = VehicleContract::field('num')->where('company_b_id',$company['id'])->where('status','in','-1,0,1,2')->sum('num'); //自有车辆数量 - $selfCar = VehicleRent::field('id')->where('company_id',$company['id'])->where('type',1)->count(); + $selfCar = VehicleRent::field('id')->where('company_id',$company['id'])->where('status','<>',3)->where('type',1)->count(); //可在租车辆 $doubleRentCar = $villageCompany - $rentCar - $applyCar - $selfCar; //设置数据