WIN-2308041133\Administrator 2 dagar sedan
förälder
incheckning
024dee76e3
1 ändrade filer med 3 tillägg och 5 borttagningar
  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 每页数量
      * @param int $pageSize 每页数量
      * @return array
      * @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;
         $pageSize = $pageSize > 50 ? 50 : (int)$pageSize;
         $page = $page <= 0 ? 1 : (int)$page;
         $page = $page <= 0 ? 1 : (int)$page;
 
 
-        $where = [
-            ['post_id', '=', $postId],
-            ['status', '=', 1]
-        ];
+        // 默认只查询已审核的评论
+        $where[] = ['c.status', '=', 1];
 
 
         $total = $this->where($where)->count();
         $total = $this->where($where)->count();
         $list = [];
         $list = [];