WIN-2308041133\Administrator 1 day ago
parent
commit
024dee76e3
1 changed files with 3 additions and 5 deletions
  1. 3 5
      app/model/api/ForumComment.php

+ 3 - 5
app/model/api/ForumComment.php

@@ -23,15 +23,13 @@ class ForumComment extends BaseModel
      * @param int $pageSize 每页数量
      * @return array
      */
-    public function getList($postId, $page = 1, $pageSize = 20)
+    public function getList($page, $where = [], $pageSize = 20, $filed = ['*', ""], $desc = '')
     {
         $pageSize = $pageSize > 50 ? 50 : (int)$pageSize;
         $page = $page <= 0 ? 1 : (int)$page;
 
-        $where = [
-            ['post_id', '=', $postId],
-            ['status', '=', 1]
-        ];
+        // 默认只查询已审核的评论
+        $where[] = ['c.status', '=', 1];
 
         $total = $this->where($where)->count();
         $list = [];