分页用POST应该怎么处理?

浏览:1977 发布日期:2015/10/15 分类:求助交流
    public function index(){
            $condition = array();
            if(I('post.brush')!==''){
                $tmp=array('brush'=>I('post.brush'));
                $condition=array_merge($tmp,$condition);
            }
            if(I('post.starttime')!==''||I('post.endtime')!==''){
                $starttime = strtotime(I('post.starttime'));
                $endtime = strtotime(I('post.endtime'));
                    $tmp=array(
                        'datetime'=> array(
                            array('egt',$starttime),
                            array('elt',$endtime)
                        )
                    );
                $condition=array_merge($tmp,$condition);
            }
            $count=M('Order')->where($condition)->count();
            $Page = new \Think\Page($count,20);
            $show = $Page->show();
            $list = M('Order')->where($condition)->order('id')->limit($Page->firstRow.','.$Page->listRows)->select();
            $this->assign('list',$list);
            $this->assign('page',$show);
            $this->display();
        }
我一翻页,就直接没数据了的。应该怎么把条件带过来呢?
最佳答案
评论( 相关
后面还有条评论,点击查看>>