thinkphp 以get 查询分页第二页无数据(本地好可以服务器就不行了)
if(isset($_GET['car_name'])&&$_GET['car_name']!=null){$where['wap_name']=array('like'...
if(isset($_GET['car_name']) && $_GET['car_name']!=null){
$where['wap_name']=array('like',"%{$_GET['car_name']}%");
}
//var_dump($_GET['car_name']);
$wap=M('Wap');
$where['wap_sell']=1;
$count=$wap->where($where)->count();//查询满足要求的总记录数
$page=new \Think\Page($count,7);//实例化分页类 传入总记录数和每页显示的记录数(7)
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$show=$page->show();//分页显示输出
$list=$wap->where($where)->order('wap_id DESC')->limit($page->firstRow.','.$page->listRows)->select();
$this->assign('list',$list);
$this->assign('page',$show);
//dump($list);
$this->display();
}else {
$this -> redirect("Index/login");
} 展开
$where['wap_name']=array('like',"%{$_GET['car_name']}%");
}
//var_dump($_GET['car_name']);
$wap=M('Wap');
$where['wap_sell']=1;
$count=$wap->where($where)->count();//查询满足要求的总记录数
$page=new \Think\Page($count,7);//实例化分页类 传入总记录数和每页显示的记录数(7)
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$show=$page->show();//分页显示输出
$list=$wap->where($where)->order('wap_id DESC')->limit($page->firstRow.','.$page->listRows)->select();
$this->assign('list',$list);
$this->assign('page',$show);
//dump($list);
$this->display();
}else {
$this -> redirect("Index/login");
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询