正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
| @@ -137,8 +137,8 @@ class ProjectLogic extends BaseLogic | @@ -137,8 +137,8 @@ class ProjectLogic extends BaseLogic | ||
| 137 | * @time :2023/8/30 11:57 | 137 | * @time :2023/8/30 11:57 |
| 138 | */ | 138 | */ |
| 139 | public function projectSave(){ | 139 | public function projectSave(){ |
| 140 | -// DB::beginTransaction(); | ||
| 141 | -// try { | 140 | + DB::beginTransaction(); |
| 141 | + try { | ||
| 142 | $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 | 142 | $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 |
| 143 | if($this->param['type'] == Project::TYPE_SEVEN){ | 143 | if($this->param['type'] == Project::TYPE_SEVEN){ |
| 144 | //错误单直接返回,单独处理 | 144 | //错误单直接返回,单独处理 |
| @@ -160,11 +160,11 @@ class ProjectLogic extends BaseLogic | @@ -160,11 +160,11 @@ class ProjectLogic extends BaseLogic | ||
| 160 | $this->syncImageFile($this->param['project_location'],$this->param['id']); | 160 | $this->syncImageFile($this->param['project_location'],$this->param['id']); |
| 161 | (new SyncService())->projectAcceptAddress($this->param['id']); | 161 | (new SyncService())->projectAcceptAddress($this->param['id']); |
| 162 | } | 162 | } |
| 163 | -// DB::commit(); | ||
| 164 | -// }catch (\Exception $e){ | ||
| 165 | -// DB::rollBack(); | ||
| 166 | -// $this->fail('保存失败,请联系管理员'); | ||
| 167 | -// } | 163 | + DB::commit(); |
| 164 | + }catch (\Exception $e){ | ||
| 165 | + DB::rollBack(); | ||
| 166 | + $this->fail('保存失败,请联系管理员'); | ||
| 167 | + } | ||
| 168 | return $this->success(); | 168 | return $this->success(); |
| 169 | } | 169 | } |
| 170 | 170 |
-
请 注册 或 登录 后发表评论