laravel传递分页参数
laravel传递分页参数
$commentArray = Comment::leftJoin('users', 'users.id', '=', 'comments.user_id')
->where([
['comments.article_id', '=', $art_id],
['comments.status', '=', 1],
['comments.type', '=', 1],
['comments.pid', '=', 0],
])->select('comments.id', 'comments.pid', 'comments.content', 'comments.created_at', 'comments.user_id', 'users.name', 'users.avatar')
->orderBy('comments.created_at', 'desc')
->paginate($comment_limit, ['*'], 'comment_page', $comment_page);
//comment_limit =5;//限制5条
//comment_page = 1; //第一页
本文链接:https://www.choudalao.com/article/84
转载请注明来源,感谢尊重原创内容。
留言评论
支持表情、回复和点赞。评论需要先登录。