|
...
|
...
|
@@ -54,15 +54,16 @@ class KeywordLogic extends BaseLogic |
|
|
|
$this->param = $this->handleSaveParam($this->param);
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
$id = $this->param['id'];
|
|
|
|
}else{
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$this->param['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$this->param['updated_at'] = $this->param['created_at'];
|
|
|
|
$id = $this->model->insertGetId($this->param);
|
|
|
|
}
|
|
|
|
//路由映射
|
|
|
|
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
//清除缓存
|
|
|
|
Common::del_user_cache('product_keyword',$this->user['project_id']);
|
|
|
|
DB::commit();
|
|
...
|
...
|
@@ -92,6 +93,12 @@ class KeywordLogic extends BaseLogic |
|
|
|
if(isset($param['keyword_video']) && !empty($param['keyword_video'])){
|
|
|
|
$param['keyword_video'] = Arr::a2s($param['keyword_video']);
|
|
|
|
}
|
|
|
|
if(!empty($param['related_news_ids'])){
|
|
|
|
$param['related_news_ids'] = Arr::arrToSet($param['related_news_ids']);
|
|
|
|
}
|
|
|
|
if(!empty($param['related_blog_ids'])){
|
|
|
|
$param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids']);
|
|
|
|
}
|
|
|
|
return $param;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|