fixed
This commit is contained in:
parent
a9921963e0
commit
4147c51dbe
@ -84,6 +84,8 @@ class ContractController extends BaseApiController
|
||||
$contract->where('id', $contract['id'])->save($params);
|
||||
if($contract['type'] == 0){
|
||||
foreach($cars as $v){
|
||||
$hasCar = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
||||
if($hasCar->isEmpty()){
|
||||
$data[] = [
|
||||
'car_id' => $v['id'],
|
||||
'contract_id' => $contract['id'],
|
||||
@ -98,9 +100,12 @@ class ContractController extends BaseApiController
|
||||
'use_user_phone' => ''
|
||||
];
|
||||
}
|
||||
}
|
||||
$status = 2;
|
||||
}else if($contract['type'] == 1) {
|
||||
foreach($cars as $v){
|
||||
$hasCar = VehicleRent::where('car_id',$v['id'])->findOrEmpty();
|
||||
if($hasCar->isEmpty()){
|
||||
$data[] = [
|
||||
'car_id' => $v['id'],
|
||||
'contract_id' => $contract['id'],
|
||||
@ -110,11 +115,12 @@ class ContractController extends BaseApiController
|
||||
'company_phone' => $contract['company_b_phone'],
|
||||
'create_time' => time(),
|
||||
'status' => 2,
|
||||
'use_user_id' => 0,
|
||||
'use_user_name' => $contract['company_b_user'],
|
||||
'use_user_phone' => $contract['company_b_phone']
|
||||
'use_user_id' =>$params['user_id'],
|
||||
'use_user_name' =>$params['use_user_name'],
|
||||
'use_user_phone' =>$params['use_user_phone'],
|
||||
];
|
||||
}
|
||||
}
|
||||
$status = 4;
|
||||
}
|
||||
//更新本地车辆状态
|
||||
|
Loading…
x
Reference in New Issue
Block a user