|
...
|
...
|
@@ -153,14 +153,14 @@ class BlogLogic extends BaseLogic |
|
|
|
if(isset($this->param['id'])){
|
|
|
|
$param['operator_id'] = $this->user['id'];
|
|
|
|
if(isset($param['category_id']) && !empty($param['category_id'])){
|
|
|
|
$param['category_id'] = $this->getLastCategory($param['category_id']);
|
|
|
|
$param['category_id'] = $this->getCategory($param['category_id']);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$param['create_id'] = $this->user['id'];
|
|
|
|
$param['operator_id'] = $this->user['id'];
|
|
|
|
$param['project_id'] = $this->user['project_id'];
|
|
|
|
if(isset($param['category_id']) && !empty($param['category_id'])){
|
|
|
|
$param['category_id'] = $this->getLastCategory($param['category_id']);
|
|
|
|
$param['category_id'] = $this->getCategory($param['category_id']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($param);
|
|
...
|
...
|
@@ -173,16 +173,12 @@ class BlogLogic extends BaseLogic |
|
|
|
* @method :post
|
|
|
|
* @time :2023/10/20 9:02
|
|
|
|
*/
|
|
|
|
public function getLastCategory($category){
|
|
|
|
public function getCategory($category){
|
|
|
|
$str = '';
|
|
|
|
$cateModel = new BlogCategoryModel();
|
|
|
|
foreach ($category as $v){
|
|
|
|
$info = $cateModel->read(['pid'=>$v]);
|
|
|
|
if($info === false){
|
|
|
|
$str .= $v.',';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ','.$str;
|
|
|
|
return !empty($str) ? ','.$str : '';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|