123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- /**
- * 打印管理模型类
- * @author jiangfei
- * @date 2015-10-20 15:30:00
- * @company 上海风车教育有限公司.
- */
- // class Exam extends CActiveRecord{
- class ClassExamPrinter extends MyActiveRecord{
-
- public static function model($className = __CLASS__){
- return parent::model($className);
- }
- public function tableName(){
- return 'class_exam_printer';
- }
-
- // 打印任务列表
- public function getPrintList(){
-
- $data = array();
-
- $criteria = new CDbCriteria();
- $criteria->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;
- }
-
- }
|