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