作者 lyh

gx

... ... @@ -74,7 +74,7 @@ class Handler extends ExceptionHandler
}
//验证错误(非手动抛出)
elseif ($exception instanceof ValidationException) {
LogUtils::error("参数验证失败", [], $exceptionMessage);
// LogUtils::error("参数验证失败", [], $exceptionMessage);
}
//Redis错误(非手动抛出)
elseif ($exception instanceof \RedisException) {
... ...
... ... @@ -352,9 +352,8 @@ class ProjectController extends BaseController
* @method :post
* @time :2023/8/17 16:42
*/
public function save(ProjectRequest $request, ProjectLogic $logic)
public function save(ProjectLogic $logic)
{
$request->validated();
$logic->projectSave();
$this->response('success');
}
... ...
... ... @@ -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 : '';
}
/**
... ...