作者 lyh

gx

@@ -108,6 +108,7 @@ class KeywordLogic extends BaseLogic @@ -108,6 +108,7 @@ class KeywordLogic extends BaseLogic
108 try { 108 try {
109 $idArr = []; 109 $idArr = [];
110 foreach ($this->param['title'] as $v){ 110 foreach ($this->param['title'] as $v){
  111 + $this->model = new Keyword();
111 $info = $this->model->read(['title'=>$v]); 112 $info = $this->model->read(['title'=>$v]);
112 if($info === false){ 113 if($info === false){
113 $param['project_id'] = $this->user['project_id']; 114 $param['project_id'] = $this->user['project_id'];
@@ -120,6 +121,7 @@ class KeywordLogic extends BaseLogic @@ -120,6 +121,7 @@ class KeywordLogic extends BaseLogic
120 } 121 }
121 //批量生成路由 122 //批量生成路由
122 foreach ($idArr as $v){ 123 foreach ($idArr as $v){
  124 + $this->model = new Keyword();
123 $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $this->user['project_id']); 125 $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $this->user['project_id']);
124 $this->model->edit(['route'=>$route],['id'=>$v['id']]); 126 $this->model->edit(['route'=>$route],['id'=>$v['id']]);
125 } 127 }