|
@@ -153,14 +153,14 @@ class BlogLogic extends BaseLogic |
|
@@ -153,14 +153,14 @@ class BlogLogic extends BaseLogic |
|
153
|
if(isset($this->param['id'])){
|
153
|
if(isset($this->param['id'])){
|
|
154
|
$param['operator_id'] = $this->user['id'];
|
154
|
$param['operator_id'] = $this->user['id'];
|
|
155
|
if(isset($param['category_id']) && !empty($param['category_id'])){
|
155
|
if(isset($param['category_id']) && !empty($param['category_id'])){
|
|
156
|
- $param['category_id'] = $this->getLastCategory($param['category_id']);
|
156
|
+ $param['category_id'] = $this->getCategory($param['category_id']);
|
|
157
|
}
|
157
|
}
|
|
158
|
}else{
|
158
|
}else{
|
|
159
|
$param['create_id'] = $this->user['id'];
|
159
|
$param['create_id'] = $this->user['id'];
|
|
160
|
$param['operator_id'] = $this->user['id'];
|
160
|
$param['operator_id'] = $this->user['id'];
|
|
161
|
$param['project_id'] = $this->user['project_id'];
|
161
|
$param['project_id'] = $this->user['project_id'];
|
|
162
|
if(isset($param['category_id']) && !empty($param['category_id'])){
|
162
|
if(isset($param['category_id']) && !empty($param['category_id'])){
|
|
163
|
- $param['category_id'] = $this->getLastCategory($param['category_id']);
|
163
|
+ $param['category_id'] = $this->getCategory($param['category_id']);
|
|
164
|
}
|
164
|
}
|
|
165
|
}
|
165
|
}
|
|
166
|
return $this->success($param);
|
166
|
return $this->success($param);
|
|
@@ -173,16 +173,12 @@ class BlogLogic extends BaseLogic |
|
@@ -173,16 +173,12 @@ class BlogLogic extends BaseLogic |
|
173
|
* @method :post
|
173
|
* @method :post
|
|
174
|
* @time :2023/10/20 9:02
|
174
|
* @time :2023/10/20 9:02
|
|
175
|
*/
|
175
|
*/
|
|
176
|
- public function getLastCategory($category){
|
176
|
+ public function getCategory($category){
|
|
177
|
$str = '';
|
177
|
$str = '';
|
|
178
|
- $cateModel = new BlogCategoryModel();
|
|
|
|
179
|
foreach ($category as $v){
|
178
|
foreach ($category as $v){
|
|
180
|
- $info = $cateModel->read(['pid'=>$v]);
|
|
|
|
181
|
- if($info === false){
|
|
|
|
182
|
$str .= $v.',';
|
179
|
$str .= $v.',';
|
|
183
|
- }
|
|
|
|
184
|
}
|
180
|
}
|
|
185
|
- return ','.$str;
|
181
|
+ return !empty($str) ? ','.$str : '';
|
|
186
|
}
|
182
|
}
|
|
187
|
|
183
|
|
|
188
|
/**
|
184
|
/**
|