update
This commit is contained in:
parent
a22f06d996
commit
8a9f8110dc
@ -12,7 +12,6 @@ use think\facade\Db;
|
|||||||
class VehicleController extends BaseApiController
|
class VehicleController extends BaseApiController
|
||||||
{
|
{
|
||||||
public string $url = 'https://logistics.lihaink.cn';
|
public string $url = 'https://logistics.lihaink.cn';
|
||||||
// public string $url = 'http://www.lst.local';
|
|
||||||
//镇街公司想物流平台申请租赁车辆
|
//镇街公司想物流平台申请租赁车辆
|
||||||
public function setContractByTownCompany()
|
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();
|
$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');
|
$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;
|
$doubleRentCar = $villageCompany - $rentCar - $applyCar - $selfCar;
|
||||||
if($params['num'] > $doubleRentCar ){
|
if($params['num'] > $doubleRentCar ){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user