作者 lyh

gx脚本更新路由

@@ -107,5 +107,5 @@ class UpdateKeyword extends Command @@ -107,5 +107,5 @@ class UpdateKeyword extends Command
107 shell_exec('curl -k "'.$url.'"'); 107 shell_exec('curl -k "'.$url.'"');
108 return true; 108 return true;
109 } 109 }
110 - 110 +
111 } 111 }
@@ -208,8 +208,11 @@ class ProductLogic extends BaseLogic @@ -208,8 +208,11 @@ class ProductLogic extends BaseLogic
208 public function editList(){ 208 public function editList(){
209 $category_ids = $this->param['category_id']; 209 $category_ids = $this->param['category_id'];
210 $this->param['category_id'] = $this->handleListCategory($this->param['category_id']); 210 $this->param['category_id'] = $this->handleListCategory($this->param['category_id']);
211 - $keyword_arr = $this->param['keyword_id'];  
212 - $this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']); 211 + $keyword_arr = $this->saveKeyword($this->param['keyword_id']);
  212 + $this->param['keyword_id'] = '';
  213 + if(!empty($keyword_arr)){
  214 + $this->param['keyword_id'] = ','.implode(',',$keyword_arr).',';
  215 + }
213 if(isset($this->param['gallery']) && !empty($this->param['gallery'])){ 216 if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
214 foreach ($this->param['gallery'] as $k => $v){ 217 foreach ($this->param['gallery'] as $k => $v){
215 $v['url'] = str_replace_url($v['url']); 218 $v['url'] = str_replace_url($v['url']);
@@ -242,7 +245,7 @@ class ProductLogic extends BaseLogic @@ -242,7 +245,7 @@ class ProductLogic extends BaseLogic
242 * @time :2023/10/26 9:51 245 * @time :2023/10/26 9:51
243 */ 246 */
244 public function saveKeyword($keyword){ 247 public function saveKeyword($keyword){
245 - $str = ''; 248 + $arr = [];
246 if(isset($keyword) && !empty($keyword)){ 249 if(isset($keyword) && !empty($keyword)){
247 $arr = []; 250 $arr = [];
248 $keywordModel = new Keyword(); 251 $keywordModel = new Keyword();
@@ -267,9 +270,8 @@ class ProductLogic extends BaseLogic @@ -267,9 +270,8 @@ class ProductLogic extends BaseLogic
267 $arr[] = $info['id']; 270 $arr[] = $info['id'];
268 } 271 }
269 } 272 }
270 - $str = ','.implode(',',$arr).',';  
271 } 273 }
272 - return $str; 274 + return $arr;
273 } 275 }
274 276
275 /** 277 /**