作者 lyh

gx

... ... @@ -177,20 +177,20 @@ class SyncProject extends Command
'bill' => $param['images'],
],
];
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
$id = $this->saveProject($data['project']);
$this->setPostId($data['deploy_build']['plan'],$id);
$this->savePayment($data['payment'],$id);
$this->saveDeployBuild($data['deploy_build'],$id);
$this->saveDeployOptimize($data['deploy_optimize'],$id);
$this->saveAfter($data['project_after'],$id);
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// errorLog('项目同步失败', $data, $e);
// $this->fail('同步失败');
// }
DB::commit();
}catch (\Exception $e){
DB::rollBack();
errorLog('项目同步失败', $data, $e);
$this->fail('同步失败');
}
}
/**
... ...
... ... @@ -125,6 +125,7 @@ class ProjectLogic extends BaseLogic
$param['confirm_file'] = Arr::a2s($param['confirm_file']);
}
unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],$param['online_check'],$param['project_after']);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($param, true) . PHP_EOL, FILE_APPEND);
$this->model->edit($param,['id'=>$param['id']]);
Common::del_user_cache($this->model->getTable(),$param['id']);
return $this->success();
... ...