正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
| @@ -53,8 +53,8 @@ class ProductLogic extends BaseLogic | @@ -53,8 +53,8 @@ class ProductLogic extends BaseLogic | ||
| 53 | }else{ | 53 | }else{ |
| 54 | $this->param['category_id'] = ''; | 54 | $this->param['category_id'] = ''; |
| 55 | } | 55 | } |
| 56 | -// DB::connection('custom_mysql')->beginTransaction(); | ||
| 57 | -// try { | 56 | + DB::connection('custom_mysql')->beginTransaction(); |
| 57 | + try { | ||
| 58 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 58 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 59 | $id = $this->param['id']; | 59 | $id = $this->param['id']; |
| 60 | //查看路由是否更新 | 60 | //查看路由是否更新 |
| @@ -70,11 +70,11 @@ class ProductLogic extends BaseLogic | @@ -70,11 +70,11 @@ class ProductLogic extends BaseLogic | ||
| 70 | CategoryRelated::saveRelated($id, $category_ids); | 70 | CategoryRelated::saveRelated($id, $category_ids); |
| 71 | //保存扩展字段 | 71 | //保存扩展字段 |
| 72 | $this->saveExtendInfo($id,$extend); | 72 | $this->saveExtendInfo($id,$extend); |
| 73 | -// DB::connection('custom_mysql')->commit(); | ||
| 74 | -// }catch (\Exception $e){ | ||
| 75 | -// DB::connection('custom_mysql')->rollBack(); | ||
| 76 | -// $this->fail('系统错误请联系管理员'); | ||
| 77 | -// } | 73 | + DB::connection('custom_mysql')->commit(); |
| 74 | + }catch (\Exception $e){ | ||
| 75 | + DB::connection('custom_mysql')->rollBack(); | ||
| 76 | + $this->fail('系统错误请联系管理员'); | ||
| 77 | + } | ||
| 78 | //通知更新 | 78 | //通知更新 |
| 79 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]); | 79 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT, 'route'=>$this->param['route']]); |
| 80 | return $this->success(); | 80 | return $this->success(); |
-
请 注册 或 登录 后发表评论