php怎么實(shí)現(xiàn)分頁 thinkphp怎么實(shí)現(xiàn)分頁排序?
thinkphp怎么實(shí)現(xiàn)分頁排序?$user=m(“user”)//實(shí)例化用戶對(duì)象$count=$user->where(“status=1”)->count()//查詢滿足要求的記錄總數(shù)$p
thinkphp怎么實(shí)現(xiàn)分頁排序?
$user=m(“user”)//實(shí)例化用戶對(duì)象
$count=$user->where(“status=1”)->count()//查詢滿足要求的記錄總數(shù)
$page=newthinkpage($count,25)//實(shí)例化傳入記錄的總數(shù)和每頁顯示的記錄數(shù)(25)
$show=$page->show()//顯示輸出頁
$list=$user->where(“status=1”)->order(“createTime desc”)->limit($page->firstrow)。", ". $page->listrows)->select()
$this->assign(“page”,$show)
非常簡單,您可以試試