Merge pull request 'update' (#92) from zhangwei into master

Reviewed-on: http://git.excellentkk.cn/mkm/TaskSystem/pulls/92
This commit is contained in:
wei1990 2023-09-01 13:58:18 +08:00
commit f78238c054

View File

@ -12,7 +12,6 @@ use think\facade\Db;
class VehicleController extends BaseApiController
{
public string $url = 'https://logistics.lihaink.cn';
// public string $url = 'http://www.lst.local';
//镇街公司想物流平台申请租赁车辆
public function setContractByTownCompany()
{
@ -25,11 +24,11 @@ class VehicleController extends BaseApiController
//获取该公司已签约的小组服务公司数量
$villageCompany = Contract::field('id')->where('party_a',$this->userInfo['company_id'])->where('signing_timer',2)->count();
//系统车辆数量
$rentCar = VehicleRent::field('id')->where('company_id',$this->userInfo['company_id'])->where('type',0)->count();
$rentCar = VehicleRent::field('id')->where('company_id',$this->userInfo['company_id'])->where('status','<>',3)->where('type',0)->count();
//申请中的车辆
$applyCar = VehicleContract::field('num')->where('company_b_id',$this->userInfo['company_id'])->where('status','in','-1,0,1,2')->sum('num');
//自有车辆数量
$selfCar = VehicleRent::field('id')->where('company_id',$this->userInfo['company_id'])->where('type',1)->count();
$selfCar = VehicleRent::field('id')->where('company_id',$this->userInfo['company_id'])->where('status','<>',3)->where('type',1)->count();
//可在租车辆
$doubleRentCar = $villageCompany - $rentCar - $applyCar - $selfCar;
if($params['num'] > $doubleRentCar ){