This commit is contained in:
mkm 2023-08-31 18:13:17 +08:00
commit aad3add884
2 changed files with 7 additions and 13 deletions
app
adminapi/controller/contract
api/controller

@ -78,12 +78,14 @@ class VehicleContractController extends BaseAdminController
if(isset($param['contract_no'])){
$where[] = ['contract_no','like','%'.$param['contract_no'].'%'];
}
if(isset($param['status'])){
$where[] = ['status','=', $param['contract_no']];
if(isset($param['status']) && in_array($param['status'],[0,1])){
$where[] = ['status','=', $param['status']];
}else{
$where[] = ['status','in', '0,1'];
}
$pageNo = !empty($param['page_no']) ? $param['page_no'] : 1;
$pageSize = !empty($param['page_size']) ? $param['page_size'] : 15;
$data = VehicleContract::where($where)->where('status','in','0,1')
$data = VehicleContract::where($where)
->page($pageNo, $pageSize)
->order('create_time desc')
->select()->each(function($item){

@ -271,15 +271,7 @@ class VehicleController extends BaseApiController
if($vehicleContract['company_a_id'] != $this->userInfo['company_id']){
return $this->fail('数据不匹配');
}
if(!empty($vehicleContract['cars_info'])){
$vehicleContract['cars_info'] = json_decode($vehicleContract['cars_info'],true);
}
//判断申请状态
if($vehicleContract['status'] == -1){
$vehicleRentCars = VehicleRent::where('company_id',$vehicleContract['company_a_id'])->where('status',0)->select()->toArray();
}else{
$vehicleRentCars = [];
}
$vehicleRentCars = VehicleRent::where('company_id',$vehicleContract['company_a_id'])->select()->toArray();
$data = [
'vehicleContract' => $vehicleContract->toArray(),
'vehicleRentCars' => $vehicleRentCars
@ -298,7 +290,7 @@ class VehicleController extends BaseApiController
return $this->fail('非镇街公司不能访问');
}
//获取小组服务公司申请信息
$vehicleContract = VehicleContract::where('company_a_id',$company['id'])->where('status',-1)->limit(2)->order('create_time desc')->select()->toArray();
$vehicleContract = VehicleContract::where('company_a_id',$company['id'])->where('status','in','-1,0,1,2')->limit(2)->order('create_time desc')->select()->toArray();
//获取车辆列表
$vehicleRentCars = VehicleRent::where('company_id',$company['id'])->select()->each(function($item){
if($item['status'] == 2){