$Table = M(‘Table‘);
$count = $Table ->where()->count();
$Page = new \Think\Page($count,10);
//自定义分页样式
$Page -> setConfig(‘next‘,‘下一页‘);
$Page -> setConfig(‘prev‘,‘上一页‘);
$Page -> setConfig(‘last‘,‘尾页‘);
$Page -> setConfig(‘first‘,‘首页‘);
$Page -> setConfig(‘theme‘,‘%HEADER% %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END%‘);
$show = $Page->show();
$this->assign(‘page‘,$show);
$res = $Table->where()->limit($Page->firstRow.‘,‘.$Page->listRows)->select();
$this->assign(‘res‘,$res);
时间: 2024-10-20 04:02:16