|
|
@@ -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 = [];
|