//示例
public function index(){
$order = M("order");
// 构造查询条件
$condition['user_id'] = I('get.user_id');
$condition['equip'] = I('get.equip');
// 计算总数
$count = $order->where($condition)->count();
// 导入分页类
//import("ORG.Util.Page");
// 实例化分页类
$p = new \Think\Page($count, 3);
foreach($condition as $key=>$val) {
$p->parameter .= "&$key=".urlencode($val);
}
// 分页显示输出
$show = $p->show();
// 当前页数据查询
$list = $order->where($condition)->order('id DESC')->limit($p->firstRow.','.$p->listRows)->select();
// 赋值赋值
$this->assign('show', $show);
$this->assign('list', $list);
$this->display();
}
分页类自带有 $parameter; // 分页跳转时要带的参数 将参数拼接到这后面即可