Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
3dba51a7b3
@ -277,12 +277,16 @@ class VehicleContractController extends BaseAdminController
|
|||||||
$cars[$k]['type'] = 0;
|
$cars[$k]['type'] = 0;
|
||||||
}
|
}
|
||||||
if($data['type'] == 1){
|
if($data['type'] == 1){
|
||||||
$rentInfo = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
if(empty($v['id'])){
|
||||||
if($rentInfo->isEmpty()){
|
$cars[$k]['type'] = 1;
|
||||||
$cars[$k]['type'] = 0;
|
}else{
|
||||||
}else{
|
$rentInfo = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
||||||
$cars[$k]['type'] = $rentInfo['type'];
|
if($rentInfo->isEmpty()){
|
||||||
}
|
$cars[$k]['type'] = 0;
|
||||||
|
}else{
|
||||||
|
$cars[$k]['type'] = $rentInfo['type'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($data['type'] == 2){
|
if($data['type'] == 2){
|
||||||
$rentInfo = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
$rentInfo = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
||||||
|
@ -385,7 +385,7 @@ class VehicleController extends BaseApiController
|
|||||||
foreach ($vehicleContract_pre as $v) {
|
foreach ($vehicleContract_pre as $v) {
|
||||||
$vehicleBuy = VehicleBuyRecord::where('contract_id',$v['id'])->findOrEmpty();
|
$vehicleBuy = VehicleBuyRecord::where('contract_id',$v['id'])->findOrEmpty();
|
||||||
if($vehicleBuy->isEmpty()){
|
if($vehicleBuy->isEmpty()){
|
||||||
$vehicleContract = $v;
|
$vehicleContract[] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//获取车辆列表
|
//获取车辆列表
|
||||||
@ -778,6 +778,11 @@ class VehicleController extends BaseApiController
|
|||||||
'update_time' => time(),
|
'update_time' => time(),
|
||||||
]);
|
]);
|
||||||
//生成关联记录
|
//生成关联记录
|
||||||
|
if($xzRentCars['type'] == 0){
|
||||||
|
$status = 2;
|
||||||
|
}else{
|
||||||
|
$status = 1;
|
||||||
|
}
|
||||||
VehicleBuyRecord::create([
|
VehicleBuyRecord::create([
|
||||||
'company_id' => $xzCompany['id'],
|
'company_id' => $xzCompany['id'],
|
||||||
'company_name' => $xzCompany['company_name'],
|
'company_name' => $xzCompany['company_name'],
|
||||||
@ -787,7 +792,7 @@ class VehicleController extends BaseApiController
|
|||||||
'company_email' => $xzCompany['master_email'],
|
'company_email' => $xzCompany['master_email'],
|
||||||
'cars_info' => json_encode($cars),
|
'cars_info' => json_encode($cars),
|
||||||
'num' => count($cars),
|
'num' => count($cars),
|
||||||
'status' => 2,
|
'status' => $status,
|
||||||
'contract_id' => $res->id,
|
'contract_id' => $res->id,
|
||||||
'create_time' => time()
|
'create_time' => time()
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user