$map = array();
$id = intval($_REQUEST['id']);
$p = intval($_REQUEST['p']);
if(!empty($p)){
$pageMap['p'] = $p;
}
if(!empty($_REQUEST['id'])){
$map['id'] = array('gt',$id);
$pageMap['id'] = $id;
}
$db = &M('user');
$count = $db->where($map)->count();
$Page = new \Think\Page($count,25,$pageMap);
/*foreach($map as $key=>$val) {
$Page->parameter .= "$key=".urlencode($val).'&';
}*/
$show = $Page->show();
$list = $db->where($map)->limit($Page->firstRow.','.$Page->listRows)->select();
$this->assign('map',$pageMap);
$this->assign('page',$show);
$this -> assign('list',$list);
$this -> display(); 最佳答案