page分页,怎么带查询参数?

浏览:2581 发布日期:2015/09/16 分类:求助交流
public function swzq(){
       if($_GET['type'])$map['type']=$_GET['type'];
       if($_GET['title'])$map['title']=array('LIKE','%'.$_GET['title'].'%');
       if($_GET['gg1'] OR $_GET['gg2']){
           $g1=$_GET['gg1']?:0;$g2=$_GET['gg2']?:1000;
           $map['size']=array('BETWEEN',array($g1,$g2));}
       if($_GET['jg1'] OR $_GET['jg2']){
           $j1=$_GET['jg1']?:0;$j2=$_GET['jg2']?:10000;
           $map['price']=array('BETWEEN',array($j1,$j2));} 
       $LG=M('Pro'); 
       $list = $LG->where($map)->order('ut desc')->page($_GET['p'],'4')->select();  
       $count      = $LG->where($map)->count();
       $Page       = new \Think\Page($count,4);
          
       foreach($map as $key=>$val) { 
          $Page->parameter   .=   "$key=".urlencode(555).'&';}
       $show       = $Page->show();       
       $this->assign('list',$list);
       $this->assign('show',$show);    
       $this->assign('hdp',$this->ads(11));
       $this->assign('so',$_GET);                               
       $this->display();
    }
<span class="butt"><div>  <span class="current">1</span><a class="num" href="/t/index.php/Index/Min/swzq.html">2</a> <a class="next" href="/t/index.php/Index/Min/swzq.html">>></a> </div></span>//第二页,过去可以参数。可能是控制器写法不对。但是不知道怎么写。另外想弄成POST提交
最佳答案
评论( 相关
后面还有条评论,点击查看>>