作者 lyh

gx

... ... @@ -93,8 +93,8 @@ class KeywordController extends BaseController
'title.required' => 'title不能为空',
'title.array' => 'title为数组'
]);
$data = $logic->batchAdd();
$this->response('success',Code::SUCCESS,$data);
$logic->batchAdd();
$this->response('success');
}
/**
... ...
... ... @@ -112,7 +112,6 @@ class BlogLabelLogic extends BaseLogic
* @time :2023/8/28 14:03
*/
public function batchAdd(){
$ids = [];
if(!empty($this->param['name']) && is_array($this->param['name'])){
foreach ($this->param['name'] as $v){
$this->verifyParamName($v);
... ... @@ -120,11 +119,10 @@ class BlogLabelLogic extends BaseLogic
$param['operator_id'] = $this->user['id'];
$param['project_id'] = $this->user['project_id'];
$param['name'] = $v;
$id = $this->model->insertGetId($param);
$ids[] = $id;
$this->model->add($param);
}
}
return $this->success($ids);
return $this->success();
}
/**
... ...
... ... @@ -79,7 +79,6 @@ class KeywordLogic extends BaseLogic
* @time :2023/8/28 14:03
*/
public function batchAdd(){
$ids = [];
if(!empty($this->param['title']) && is_array($this->param['title'])){
foreach ($this->param['title'] as $v){
$param['project_id'] = $this->user['project_id'];
... ... @@ -87,11 +86,10 @@ class KeywordLogic extends BaseLogic
$param['updated_at'] = $param['created_at'];
$param['title'] = $v;
$id = $this->model->insertGetId($param);
$ids[] = $id;
RouteMap::setRoute($v, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
}
}
return $this->success($ids);
return $this->success();
}
/**
... ...