正在显示
1 个修改的文件
包含
3 行增加
和
0 行删除
| @@ -75,6 +75,7 @@ class RenewLogic extends BaseLogic | @@ -75,6 +75,7 @@ class RenewLogic extends BaseLogic | ||
| 75 | if($info['project_id'] != 0){ | 75 | if($info['project_id'] != 0){ |
| 76 | $this->fail('当前续费单已关联项目,请重新选择'); | 76 | $this->fail('当前续费单已关联项目,请重新选择'); |
| 77 | } | 77 | } |
| 78 | + DB::beginTransaction(); | ||
| 78 | try { | 79 | try { |
| 79 | $this->model->edit(['project_id'=>$this->param['id'],'operator_id'=>$this->manager['id']],['id'=>$this->param['renew_id']]); | 80 | $this->model->edit(['project_id'=>$this->param['id'],'operator_id'=>$this->manager['id']],['id'=>$this->param['renew_id']]); |
| 80 | $project = new Project(); | 81 | $project = new Project(); |
| @@ -83,7 +84,9 @@ class RenewLogic extends BaseLogic | @@ -83,7 +84,9 @@ class RenewLogic extends BaseLogic | ||
| 83 | $deployBuild->edit( | 84 | $deployBuild->edit( |
| 84 | ['service_duration'=>DB::raw('service_duration + ' . $info['service_duration']), | 85 | ['service_duration'=>DB::raw('service_duration + ' . $info['service_duration']), |
| 85 | 'plan'=>$info['plan']], ['project_id'=>$this->param['id']]); | 86 | 'plan'=>$info['plan']], ['project_id'=>$this->param['id']]); |
| 87 | + DB::commit(); | ||
| 86 | }catch (\Exception $e){ | 88 | }catch (\Exception $e){ |
| 89 | + DB::rollBack(); | ||
| 87 | $this->fail('系统错误,请联系管理员'); | 90 | $this->fail('系统错误,请联系管理员'); |
| 88 | } | 91 | } |
| 89 | return $this->success(); | 92 | return $this->success(); |
-
请 注册 或 登录 后发表评论