thinkphp 3.2.3 的分页类是不是有点问题啊?

浏览:536 发布日期:2016/02/29 分类:求助交流 关键字: 分页
分页的时候带入post查询条件的时候按照开发文档,总是实现不了,最后我换了个方法倒是能实现了,大家有没有遇到过?或者说我用错了?$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();
最佳答案
评论() 相关
后面还有条评论,点击查看>>