public function user() {
$condition['keywords'] = $_GET['keywords'];
$condition['search-sort']=$_GET['search-sort'];
if ($condition['keywords']) {
$where [$condition['search-sort']] = array (
'like',
'%' . $condition['keywords'] . '%'
);
}
$map['keywords'] = $_GET ['keywords'];
$map['search-sort'] = $_GET['search-sort'];
import ( 'ORG.Util.Page' );
$User = M ( 'User' );
$count = $User->where ( $where )->count ();
dump($where);
$Page = new Page ( $count, 8 );
foreach ( $map as $key => $val ) {
$Page->parameter .= "$key=" . urlencode ( $val ) . '&';
}
$list = $User->where ( $where )->limit ( $Page->firstRow . ',' . $Page->listRows )->select ();
$show = $Page->show ();
//dump($Page);
$this->assign ( 'list', $list );
$this->assign ( 'page', $show );
$this->display ();
}
点击能有查询结果,下一页就不能了
测试了一下发现点击下一页的时候本来是get的search-sort没再传过来了