作者 lyh

gx

... ... @@ -79,7 +79,7 @@ class ProductLogic extends BaseLogic
$this->param['category_id'] = $this->getLastCategory($this->param['category_id']);
}
if(isset($this->param['keyword_id']) && !empty($this->param['keyword_id'])){
$this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
$this->param['keyword_id'] = implode(',',$this->saveKeyword($this->param['keyword_id']));
}
$this->model->edit($this->param,['id'=>$this->param['id']]);
return $this->success();
... ... @@ -93,7 +93,7 @@ class ProductLogic extends BaseLogic
* @time :2023/10/26 9:51
*/
public function saveKeyword($keyword){
$str = '';
$arr = [];
if(!empty($keyword) && is_array($keyword)){
$keywordModel = new Keyword();
foreach ($keyword as $v){
... ... @@ -109,13 +109,13 @@ class ProductLogic extends BaseLogic
$this->model->edit(['route'=>$route],['id'=>$id]);
//清除缓存
Common::del_user_cache('product_keyword',$this->user['project_id']);
$str .= $id.',';
$arr[] = $id;
}else{
$str .= $info['id'];
$arr[] = $info['id'];
}
}
}
return ','.$str;
return $arr;
}
/**
... ...