addCondition('is_print=0'); $criteria->limit = 20; $criteria->order = 'add_time desc'; return $this->findAll($criteria); /* $total = $this->count($criteria); $pager = new CPagination($total); $criteria->order = 'print_time desc'; $pager->pageSize = 20; $pager->applyLimit($criteria); $data['result']=$this->findAll($criteria); $data['page']=$pager; $data['page_total']= $total; return $data; */ } // 打印任务列表 public function getResultList($classIds = array()) { $data = array(); $criteria = new CDbCriteria(); //$criteria->addCondition('is_print=0'); if ($classIds AND is_array($classIds)) { $criteria->addInCondition('class_id', $classIds); } $total = $this->count($criteria); $pager = new CPagination($total); $criteria->order = 'add_time desc, class_id ASC'; $pager->pageSize = 20; $pager->applyLimit($criteria); $data['result']=$this->findAll($criteria); $data['page']=$pager; $data['page_total']= $total; return $data; } }