获取所有显示页面的视图

时间:2012-03-05 08:47:19

标签: php mysql cakephp

if($isadmin==false){
            $type = array('EwtWork.userid'=>$userid, $sql);
            $this->paginate = array(
                'conditions'=> $type,
                'order'=>array('EwtWork.starttime'=>'desc'),
                'fields'=>array('date(EwtWork.starttime) as wdate', 
                                'time(EwtWork.starttime) as starttime', 
                                'time(EwtWork.endtime) as endtime', 'EwtWork.lateres', 
                                'EwtWork.earlyres', 'EwtWork.comments', 'EwtWork.overtime')
            );  
            $flag = 0;
        }else {
            $type = array($sql);
            $this->paginate = array(
                'conditions'=> $type,
                'order'=>array('EwtWork.starttime'=>'desc'),
                'joins' => array('JOIN ewt_users AS EwtUser ON (EwtWork.userid = EwtUser.id)'),
                'fields'=>array('date(EwtWork.starttime) as wdate', 
                                'time(EwtWork.starttime) as starttime', 'EwtUser.fullname',
                                'time(EwtWork.endtime) as endtime', 'EwtWork.lateres', 
                                'EwtWork.earlyres', 'EwtWork.comments', 'EwtWork.overtime')
            );
            $flag = 1;  
        }           
        $this->set('from', $from);
        $this->set('to', $to);
        $this->set('flag', $flag);      
        $this->set('exportdata', $this->paginate('EwtWork'));   

我不想为上面的分页器设置分页限制。如何将页面限制重置为NULL,以便我可以在单个视图中查看所有页面?

1 个答案:

答案 0 :(得分:0)

如果您想要所有记录而不是对其进行分页,只需使用$this->Model->find('all', array(...))而不是分页。