正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -762,7 +762,7 @@ class ProductLogic extends BaseLogic | @@ -762,7 +762,7 @@ class ProductLogic extends BaseLogic | ||
| 762 | try { | 762 | try { |
| 763 | if(!isset($this->param['is_cover']) || ($this->param['is_cover'] == 1)){ | 763 | if(!isset($this->param['is_cover']) || ($this->param['is_cover'] == 1)){ |
| 764 | $category_ids = ','.implode(',',$this->param['category_id']).','; | 764 | $category_ids = ','.implode(',',$this->param['category_id']).','; |
| 765 | - $this->model->edit(['category_id'=>$category_ids],['id'=>['in',$this->param['id']]]); | 765 | + $this->model->edit(['category_id'=>$category_ids,'status'=>$this->param['status'] ?? 1],['id'=>['in',$this->param['id']]]); |
| 766 | //分类关联 | 766 | //分类关联 |
| 767 | foreach ($this->param['id'] as $id){ | 767 | foreach ($this->param['id'] as $id){ |
| 768 | CategoryRelated::saveRelated($id, $this->param['category_id']); | 768 | CategoryRelated::saveRelated($id, $this->param['category_id']); |
| @@ -773,7 +773,7 @@ class ProductLogic extends BaseLogic | @@ -773,7 +773,7 @@ class ProductLogic extends BaseLogic | ||
| 773 | $productInfo = $this->model->read(['id'=>$id],['id','category_id']); | 773 | $productInfo = $this->model->read(['id'=>$id],['id','category_id']); |
| 774 | $category_ids_arr = array_values(array_unique(array_merge($productInfo['category_id'],$this->param['category_id']))); | 774 | $category_ids_arr = array_values(array_unique(array_merge($productInfo['category_id'],$this->param['category_id']))); |
| 775 | $category_ids = ','.implode(',',$category_ids_arr).','; | 775 | $category_ids = ','.implode(',',$category_ids_arr).','; |
| 776 | - $this->model->edit(['category_id'=>$category_ids],['id'=>$id]); | 776 | + $this->model->edit(['category_id'=>$category_ids,'status'=>$this->param['status'] ?? 1],['id'=>$id]); |
| 777 | CategoryRelated::saveRelated($id, $category_ids_arr); | 777 | CategoryRelated::saveRelated($id, $category_ids_arr); |
| 778 | } | 778 | } |
| 779 | } | 779 | } |
-
请 注册 或 登录 后发表评论