正在显示
1 个修改的文件
包含
10 行增加
和
0 行删除
| @@ -948,8 +948,18 @@ class ProductLogic extends BaseLogic | @@ -948,8 +948,18 @@ class ProductLogic extends BaseLogic | ||
| 948 | * @time :2024/9/20 16:48 | 948 | * @time :2024/9/20 16:48 |
| 949 | */ | 949 | */ |
| 950 | public function batchSetKeyword(){ | 950 | public function batchSetKeyword(){ |
| 951 | + if(isset($this->param['is_cover']) && $this->param['is_cover'] == 1){//覆盖 | ||
| 951 | $this->param['keyword_id'] = ','.implode(',',$this->param['keyword_id']).','; | 952 | $this->param['keyword_id'] = ','.implode(',',$this->param['keyword_id']).','; |
| 952 | $this->edit(['keyword_id'=>$this->param['keyword_id']],['id'=>['in',$this->param['id']]]); | 953 | $this->edit(['keyword_id'=>$this->param['keyword_id']],['id'=>['in',$this->param['id']]]); |
| 954 | + }else{ | ||
| 955 | + foreach ($this->param['id'] as $id){ | ||
| 956 | + //获取当前产品的分类 | ||
| 957 | + $productInfo = $this->model->read(['id'=>$id],['id','keyword_id']); | ||
| 958 | + $keyword_ids_arr = array_values(array_unique(array_merge($productInfo['keyword_id'],$this->param['keyword_id']))); | ||
| 959 | + $keyword_ids = ','.implode(',',$keyword_ids_arr).','; | ||
| 960 | + $this->model->edit(['keyword_id'=>$keyword_ids],['id'=>$id]); | ||
| 961 | + } | ||
| 962 | + } | ||
| 953 | return $this->success(); | 963 | return $this->success(); |
| 954 | } | 964 | } |
| 955 | } | 965 | } |
-
请 注册 或 登录 后发表评论