This commit is contained in:
unknown 2023-08-30 18:18:42 +08:00
parent 94f95fe8f6
commit 22db841229

View File

@ -15,7 +15,7 @@ use think\response\Json;
class VehicleController extends BaseApiController
{
//镇街公司想物流平台申请租赁车辆
public function setContractByTownCompany():Json
public function setContractByTownCompany()
{
//获取参数
$params = $this->request->post(['num']);
@ -214,6 +214,8 @@ class VehicleController extends BaseApiController
$villageCompany = Contract::where('party_a',$company_id)->where('signing_timer',2)->select();
//系统车辆数量
$rentCar = VehicleRent::field('id')->where('type',0)->select();
//可租赁车辆
$canRentCar = VehicleRent::field('id')->where('type',0)->where('status',0)->select();
//自有车辆数量
$selfCar = VehicleRent::field('id')->where('type',1)->select();
//设置数据
@ -222,6 +224,7 @@ class VehicleController extends BaseApiController
'car_list' => $carList->toArray(),
'monitor_num' => $villageCompany->count(),
'rent_num' => $rentCar->count(),
'can_rent_num' => $canRentCar->count(),
'self_num' => $selfCar->count(),
];
//返回