作者 lyh

gx

@@ -93,8 +93,8 @@ class KeywordController extends BaseController @@ -93,8 +93,8 @@ class KeywordController extends BaseController
93 'title.required' => 'title不能为空', 93 'title.required' => 'title不能为空',
94 'title.array' => 'title为数组' 94 'title.array' => 'title为数组'
95 ]); 95 ]);
96 - $data = $logic->batchAdd();  
97 - $this->response('success',Code::SUCCESS,$data); 96 + $logic->batchAdd();
  97 + $this->response('success');
98 } 98 }
99 99
100 /** 100 /**
@@ -112,7 +112,6 @@ class BlogLabelLogic extends BaseLogic @@ -112,7 +112,6 @@ class BlogLabelLogic extends BaseLogic
112 * @time :2023/8/28 14:03 112 * @time :2023/8/28 14:03
113 */ 113 */
114 public function batchAdd(){ 114 public function batchAdd(){
115 - $ids = [];  
116 if(!empty($this->param['name']) && is_array($this->param['name'])){ 115 if(!empty($this->param['name']) && is_array($this->param['name'])){
117 foreach ($this->param['name'] as $v){ 116 foreach ($this->param['name'] as $v){
118 $this->verifyParamName($v); 117 $this->verifyParamName($v);
@@ -120,11 +119,10 @@ class BlogLabelLogic extends BaseLogic @@ -120,11 +119,10 @@ class BlogLabelLogic extends BaseLogic
120 $param['operator_id'] = $this->user['id']; 119 $param['operator_id'] = $this->user['id'];
121 $param['project_id'] = $this->user['project_id']; 120 $param['project_id'] = $this->user['project_id'];
122 $param['name'] = $v; 121 $param['name'] = $v;
123 - $id = $this->model->insertGetId($param);  
124 - $ids[] = $id; 122 + $this->model->add($param);
125 } 123 }
126 } 124 }
127 - return $this->success($ids); 125 + return $this->success();
128 } 126 }
129 127
130 /** 128 /**
@@ -79,7 +79,6 @@ class KeywordLogic extends BaseLogic @@ -79,7 +79,6 @@ class KeywordLogic extends BaseLogic
79 * @time :2023/8/28 14:03 79 * @time :2023/8/28 14:03
80 */ 80 */
81 public function batchAdd(){ 81 public function batchAdd(){
82 - $ids = [];  
83 if(!empty($this->param['title']) && is_array($this->param['title'])){ 82 if(!empty($this->param['title']) && is_array($this->param['title'])){
84 foreach ($this->param['title'] as $v){ 83 foreach ($this->param['title'] as $v){
85 $param['project_id'] = $this->user['project_id']; 84 $param['project_id'] = $this->user['project_id'];
@@ -87,11 +86,10 @@ class KeywordLogic extends BaseLogic @@ -87,11 +86,10 @@ class KeywordLogic extends BaseLogic
87 $param['updated_at'] = $param['created_at']; 86 $param['updated_at'] = $param['created_at'];
88 $param['title'] = $v; 87 $param['title'] = $v;
89 $id = $this->model->insertGetId($param); 88 $id = $this->model->insertGetId($param);
90 - $ids[] = $id;  
91 RouteMap::setRoute($v, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); 89 RouteMap::setRoute($v, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
92 } 90 }
93 } 91 }
94 - return $this->success($ids); 92 + return $this->success();
95 } 93 }
96 94
97 /** 95 /**