|
...
|
...
|
@@ -140,32 +140,28 @@ class KeywordLogic extends BaseLogic |
|
|
|
if (empty($route_array)) {
|
|
|
|
$this->fail('路由生成失败,请稍后重试!');
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$num = count($this->param['title']);
|
|
|
|
if($num > 1000){
|
|
|
|
$this->fail('最大数量不能超过1000');
|
|
|
|
$num = count($this->param['title']);
|
|
|
|
if($num > 1000){
|
|
|
|
$this->fail('最大数量不能超过1000');
|
|
|
|
}
|
|
|
|
foreach ($this->param['title'] as $k=>$v){
|
|
|
|
if(empty($v)){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
foreach ($this->param['title'] as $k=>$v){
|
|
|
|
if(empty($v)){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$this->model = new Keyword();
|
|
|
|
$info = $this->model->read(['title'=>$v]);
|
|
|
|
if($info === false){
|
|
|
|
$this->model = new Keyword();
|
|
|
|
$info = $this->model->read(['title'=>$v]);
|
|
|
|
if($info === false){
|
|
|
|
// $route = $this->specialRouteCheck($v);
|
|
|
|
$param['project_id'] = $this->user['project_id'];
|
|
|
|
$param['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$param['updated_at'] = $param['created_at'];
|
|
|
|
$param['title'] = $v;
|
|
|
|
$param['project_id'] = $this->user['project_id'];
|
|
|
|
$param['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$param['updated_at'] = $param['created_at'];
|
|
|
|
$param['title'] = $v;
|
|
|
|
// $param['route'] = $route;
|
|
|
|
$id = $this->model->insertGetId($param);
|
|
|
|
$route = RouteMap::setRoute($route_array[$k], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
$id = $this->model->insertGetId($param);
|
|
|
|
$route = RouteMap::setRoute($route_array[$k], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
// $this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
...
|
...
|
|