Browse Source

fix: 评论

super-yimizi 1 month ago
parent
commit
915268f270
2 changed files with 5 additions and 8 deletions
  1. 4 7
      application/api/controller/Comment.php
  2. 1 1
      application/api/validate/Comment.php

+ 4 - 7
application/api/controller/Comment.php

@@ -24,7 +24,7 @@ class Comment extends Base
      */
     public function index()
     {
-        $params = $this->request->param();
+        $params = $this->request->post();
         
         // 验证参数
         $validate = new CommentValidate();
@@ -125,12 +125,9 @@ class Comment extends Base
         $comment_id = (int)$params['comment_id'];
         $evaluate_status = (int)$params['evaluate_status'];
         
-        try {
-            CommentService::auditComment($comment_id, $evaluate_status);
-            $this->success('审核成功');
-        } catch (\Exception $e) {
-            $this->error($e->getMessage());
-        }
+        CommentService::auditComment($comment_id, $evaluate_status);
+        $this->success('审核成功');
+    
     }
 
     /**

+ 1 - 1
application/api/validate/Comment.php

@@ -50,7 +50,7 @@ class Comment extends Validate
     ];
 
     protected $scene = [
-        'index' => ['goods_id', 'pid', 'page', 'page_size', 'order_by', 'order_way', 'has_picture'],
+        'index' => ['goods_id', 'pid', 'page', 'page_size', 'order_by', 'order_way','has_picture'],
         'add' => ['order_id', 'remark', 'pid'],
         'myList' => ['page', 'page_size'],
         'stats' => ['goods_id'],