patch
This commit is contained in:
parent
9250233746
commit
47a5cdbe61
@ -94,6 +94,7 @@ class ContractController extends BaseApiController
|
|||||||
'use_user_phone' => ''
|
'use_user_phone' => ''
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Db::startTrans();
|
||||||
try{
|
try{
|
||||||
//更新合同状态
|
//更新合同状态
|
||||||
$update_result = $contract->where('id', $contract['id'])->save($params);
|
$update_result = $contract->where('id', $contract['id'])->save($params);
|
||||||
@ -113,9 +114,14 @@ class ContractController extends BaseApiController
|
|||||||
return $this->fail('更新失败1.1');
|
return $this->fail('更新失败1.1');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Db::startTrans();
|
||||||
try{
|
try{
|
||||||
|
//获取租赁车辆
|
||||||
|
$cars = json_decode($contract['cars_info'], true);
|
||||||
$update_result = $contract->where('id', $contract['id'])->save($params);
|
$update_result = $contract->where('id', $contract['id'])->save($params);
|
||||||
if($update_result){
|
//更新本地车辆状态
|
||||||
|
$vehicle_result = Vehicle::where('id','in',array_column($cars,'id'))->update(['status'=>1]);
|
||||||
|
if($update_result && $vehicle_result){
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return $this->success('更新成功2');
|
return $this->success('更新成功2');
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user