|
@@ -53,17 +53,15 @@ class KeywordLogic extends BaseLogic |
|
@@ -53,17 +53,15 @@ class KeywordLogic extends BaseLogic |
|
53
|
try {
|
53
|
try {
|
|
54
|
$this->param = $this->handleSaveParam($this->param);
|
54
|
$this->param = $this->handleSaveParam($this->param);
|
|
55
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
55
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
56
|
- $info = $this->model->read(['id'=>$this->param['id']],['id','route']);
|
|
|
|
57
|
- $route = $info['route'];
|
|
|
|
58
|
- $this->model->edit($this->param,['id'=>$info['id']]);
|
56
|
+ $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
59
|
}else{
|
57
|
}else{
|
|
60
|
$this->param['project_id'] = $this->user['project_id'];
|
58
|
$this->param['project_id'] = $this->user['project_id'];
|
|
61
|
$this->param['created_at'] = date('Y-m-d H:i:s');
|
59
|
$this->param['created_at'] = date('Y-m-d H:i:s');
|
|
62
|
- $this->param['title'] = $this->param['title'].'-tag';
|
|
|
|
63
|
$this->param['updated_at'] = $this->param['created_at'];
|
60
|
$this->param['updated_at'] = $this->param['created_at'];
|
|
64
|
$id = $this->model->insertGetId($this->param);
|
61
|
$id = $this->model->insertGetId($this->param);
|
|
65
|
//路由映射
|
62
|
//路由映射
|
|
66
|
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
63
|
$route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
64
|
+ $route = $route.'-tag';
|
|
67
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
65
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
|
68
|
}
|
66
|
}
|
|
69
|
//清除缓存
|
67
|
//清除缓存
|