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

Reviewed-on: http://git.excellentkk.cn/mkm/TaskSystem/pulls/97
This commit is contained in:
wei1990 2023-09-01 15:25:26 +08:00
commit 74fa700021

View File

@ -4,7 +4,6 @@ namespace app\api\controller;
use app\common\enum\notice\NoticeEnum;
use app\common\model\Company;
use app\common\model\contract\Contract;
use app\common\model\contract\VehicleContract;
use app\common\model\vehicle\VehicleRent;
use think\facade\Db;
@ -22,7 +21,7 @@ class VehicleController extends BaseApiController
return $this->fail('缺少必要参数');
}
//获取该公司已签约的小组服务公司数量
$villageCompany = Contract::field('id')->where('party_a',$this->userInfo['company_id'])->where('signing_timer',2)->count();
$villageCompany = VehicleRent::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('status','<>',3)->where('type',0)->count();
//申请中的车辆
@ -210,7 +209,7 @@ class VehicleController extends BaseApiController
return $this->fail('当前小组服务公司未签约');
}
//获取签约信息
$contract = Contract::where('party_b',$this->userInfo['company_id'])->where('signing_timer',2)->find();
$contract = VehicleContract::where('party_b',$this->userInfo['company_id'])->where('signing_timer',2)->find();
$party_a = Company::field('id,company_name,master_name,master_phone,master_email,is_contract,organization_code,company_type')->where('id',$contract['party_a'])->find();
if(empty($contract) || empty($party_a)){
return $this->fail('未找到签约镇街公司');
@ -343,7 +342,7 @@ class VehicleController extends BaseApiController
}
})->toArray();
//获取该公司已签约的小组服务公司数量
$villageCompany = Contract::field('id')->where('party_a',$company['id'])->where('signing_timer',2)->count();
$villageCompany = VehicleContract::field('id')->where('party_a',$company['id'])->where('signing_timer',2)->count();
//系统车辆数量
$rentCar = VehicleRent::field('id')->where('company_id',$company['id'])->where('status','<>', 3)->where('type',0)->count();
//申请中的车辆
@ -464,7 +463,7 @@ class VehicleController extends BaseApiController
return $this->fail('当前公司与车辆信息不匹配');
}
//获取原签约信息
$contract = Contract::where('id',$carInfo['contract_id'])->where('status',3)->find();
$contract = VehicleContract::where('id',$carInfo['contract_id'])->where('status',3)->find();
if(empty($contract)){
return $this->fail('原签约信息错误');
}
@ -524,7 +523,7 @@ class VehicleController extends BaseApiController
if($company['company_type'] != 16){
return ['code'=>0,'msg'=>'非镇街公司不能访问'];
}
$data = Contract::field('contract_no,file,status,create_time,update_time')->where('contract_logistic_id','<>',0)->where('company_b_id',$company['id'])->select();
$data = VehicleContract::field('id,contract_no,file,status,create_time,update_time')->where('contract_logistic_id','<>',0)->where('company_b_id',$company['id'])->select();
return $this->success('请求成功',$data);
}