正在显示
1 个修改的文件
包含
1 行增加
和
8 行删除
| @@ -103,22 +103,15 @@ class KeywordLogic extends BaseLogic | @@ -103,22 +103,15 @@ class KeywordLogic extends BaseLogic | ||
| 103 | */ | 103 | */ |
| 104 | public function keywordDelete(){ | 104 | public function keywordDelete(){ |
| 105 | $ids = $this->param['ids']; | 105 | $ids = $this->param['ids']; |
| 106 | -// DB::beginTransaction(); | ||
| 107 | -// try { | ||
| 108 | $productModel = new Product(); | 106 | $productModel = new Product(); |
| 109 | foreach ($ids as $id){ | 107 | foreach ($ids as $id){ |
| 110 | - $product_info = $productModel->read(['category_id'=>['like','%,'.$id.',%']]); | 108 | + $product_info = $productModel->read(['keyword_id'=>['like','%,'.$id.',%']]); |
| 111 | if($product_info !== false){ | 109 | if($product_info !== false){ |
| 112 | $this->fail('当前关键词拥有产品不允许删除'); | 110 | $this->fail('当前关键词拥有产品不允许删除'); |
| 113 | } | 111 | } |
| 114 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); | 112 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); |
| 115 | } | 113 | } |
| 116 | $this->model->del(['id'=>['in',$ids]]); | 114 | $this->model->del(['id'=>['in',$ids]]); |
| 117 | -// DB::commit(); | ||
| 118 | -// }catch (\Exception $e){ | ||
| 119 | -// DB::rollBack(); | ||
| 120 | -// $this->fail('删除失败'); | ||
| 121 | -// } | ||
| 122 | return $this->success(); | 115 | return $this->success(); |
| 123 | } | 116 | } |
| 124 | 117 |
-
请 注册 或 登录 后发表评论