fixed
This commit is contained in:
parent
6d40b063c6
commit
c8ba60a049
@ -46,15 +46,14 @@ class ContractController extends BaseApiController
|
||||
];
|
||||
Db::startTrans();
|
||||
try {
|
||||
$res1 = Contract::create($data);
|
||||
if($res1->id){
|
||||
$data['contract_logistic_id'] = $res1->id;
|
||||
Db::commit();
|
||||
return $this->success('合同发起成功,等待审核',$data);
|
||||
}else{
|
||||
Db::rollback();
|
||||
return $this->fail('合同发起失败,请稍后重试');
|
||||
$res1= Contract::create($data);
|
||||
if(isset($params['cars_info']) && !empty($params['cars_info'])){
|
||||
$cars = json_decode($params['cars_info'], true);
|
||||
Vehicle::where('id','in',array_column($cars,'id'))->update(['status'=>1]);
|
||||
}
|
||||
$data['contract_logistic_id'] = $res1->id;
|
||||
Db::commit();
|
||||
return $this->success('合同发起成功,等待审核',$data);
|
||||
} catch (\Exception $e) {
|
||||
// 回滚事务
|
||||
Db::rollback();
|
||||
|
Loading…
x
Reference in New Issue
Block a user