小猪cms微信二次开发之怎样分页

        $db=D('Classify');
        $zid=$db->where(array('id'=>$this->_GET('fid'),'token'=>$this->token))->getField('fid');
        $where['token']=session('token');
        $where['fid']=intval($_GET['fid']);
        $count=$db->where($where)->count();
        $page=new Page($count,25);
        $info=$db->where($where)->order('sorts desc')->limit($page->firstRow.','.$page->listRows)->select();
        $this->assign('page',$page->show());
        $this->assign('info',$info);
        $this->assign('zid',$zid);
        $this->display();

 

//导入分页类
            include './PigCms/Lib/ORG/Page.class.php;
            $count = $db->where($where)->count();
            $Page = new Page($count, 20);
            $Page->setConfig('prev', '<');
            $Page->setConfig('next', '>');
            $Page->setConfig('theme', '%nowPage%/%totalPage% 页 %upPage% %linkPage% %downPage%');
            $res = $db->where($where)->order('usort DESC')->limit($Page->firstRow . ',' . $Page->listRows)->select();
            $show = $Page->show();
            $this->assign('page', $show);
            $res = $this->convertLinks($res);

 

 

小猪cms微信二次开发之怎样实现分页

posted @ 2016-09-27 14:47  libkey  阅读(685)  评论(0编辑  收藏  举报