欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Thinkphp使用分页 博客分类: php thinkphppaginationthinkphp分页

程序员文章站 2024-03-13 23:17:40
...
use Think\Page;

$pageCount = I('get.size',20); //每页20条
$condition = array();
$count = $model->where($condition)->count();
$Page = new Page($count, $pageCount); 
$show = $Page->show();
$objs = $model->where($condition)->order('id desc')->limit($Page->firstRow . ',' . $Page->listRows)->select();
$this->page = $show;
$this->obj = $bjs;