作者 lyh

gx

@@ -79,7 +79,7 @@ class ProductLogic extends BaseLogic @@ -79,7 +79,7 @@ class ProductLogic extends BaseLogic
79 $this->param['category_id'] = $this->getLastCategory($this->param['category_id']); 79 $this->param['category_id'] = $this->getLastCategory($this->param['category_id']);
80 } 80 }
81 if(isset($this->param['keyword_id']) && !empty($this->param['keyword_id'])){ 81 if(isset($this->param['keyword_id']) && !empty($this->param['keyword_id'])){
82 - $this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']); 82 + $this->param['keyword_id'] = implode(',',$this->saveKeyword($this->param['keyword_id']));
83 } 83 }
84 $this->model->edit($this->param,['id'=>$this->param['id']]); 84 $this->model->edit($this->param,['id'=>$this->param['id']]);
85 return $this->success(); 85 return $this->success();
@@ -93,7 +93,7 @@ class ProductLogic extends BaseLogic @@ -93,7 +93,7 @@ class ProductLogic extends BaseLogic
93 * @time :2023/10/26 9:51 93 * @time :2023/10/26 9:51
94 */ 94 */
95 public function saveKeyword($keyword){ 95 public function saveKeyword($keyword){
96 - $str = ''; 96 + $arr = [];
97 if(!empty($keyword) && is_array($keyword)){ 97 if(!empty($keyword) && is_array($keyword)){
98 $keywordModel = new Keyword(); 98 $keywordModel = new Keyword();
99 foreach ($keyword as $v){ 99 foreach ($keyword as $v){
@@ -109,13 +109,13 @@ class ProductLogic extends BaseLogic @@ -109,13 +109,13 @@ class ProductLogic extends BaseLogic
109 $this->model->edit(['route'=>$route],['id'=>$id]); 109 $this->model->edit(['route'=>$route],['id'=>$id]);
110 //清除缓存 110 //清除缓存
111 Common::del_user_cache('product_keyword',$this->user['project_id']); 111 Common::del_user_cache('product_keyword',$this->user['project_id']);
112 - $str .= $id.','; 112 + $arr[] = $id;
113 }else{ 113 }else{
114 - $str .= $info['id']; 114 + $arr[] = $info['id'];
115 } 115 }
116 } 116 }
117 } 117 }
118 - return ','.$str; 118 + return $arr;
119 } 119 }
120 120
121 /** 121 /**