作者 lyh

gx

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