patch
This commit is contained in:
parent
47a5cdbe61
commit
9e6275f99e
@ -116,12 +116,13 @@ class ContractController extends BaseApiController
|
|||||||
}
|
}
|
||||||
Db::startTrans();
|
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(isset($params['cars_info']) && !empty($params['cars_info'])){
|
||||||
$vehicle_result = Vehicle::where('id','in',array_column($cars,'id'))->update(['status'=>1]);
|
$cars = json_decode($contract['cars_info'], true);
|
||||||
if($update_result && $vehicle_result){
|
//更新本地车辆状态
|
||||||
|
$vehicle_result = Vehicle::where('id','in',array_column($cars,'id'))->update(['status'=>1]);
|
||||||
|
}
|
||||||
|
if($update_result){
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return $this->success('更新成功2');
|
return $this->success('更新成功2');
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user