laravel传递分页参数

臭大佬 2019-12-04 23:32:17 1446
简介 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; //第一页