thinkphp5菜鸟教程 thinkphp怎么实现分页排序?

thinkphp怎么实现分页排序?$user=m(“user”)//实例化用户对象$count=$user->where(“status=1”)->count()//查询满足要求的记录总数$p

thinkphp怎么实现分页排序?

$user=m(“user”)//实例化用户对象

$count=$user->where(“status=1”)->count()//查询满足要求的记录总数

$page=newthinkpage($count,25)//实例化传入记录的总数和每页显示的记录数(25)

$show=$page->show()//显示输出页

$list=$user->where(“status=1”)->order(“createTime desc”)->limit($page->firstrow)。", ". $page->listrows)->select()

$this->assign(“page”,$show)

非常简单,您可以试试