NotifyModel.php 902 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * 消息通知模型类
  4. * @author jiangfei
  5. * @date 2015-10-16 10:30:00
  6. * @company 上海风车教育有限公司.
  7. */
  8. class NotifyModel extends MyActiveRecord{
  9. public static function model($className = __CLASS__){
  10. return parent::model($className);
  11. }
  12. public function tableName(){
  13. return 'notification';
  14. }
  15. // 年级列表
  16. public function getNotifyList($semeseter_id=''){
  17. //$data = array();
  18. $criteria = new CDbCriteria();
  19. $semeseter_id && $criteria->addCondition('semester_id="'.$semeseter_id.'"');
  20. //$total = $this->count($criteria);
  21. //$pager = new CPagination($total);
  22. $criteria->order = 'id desc';
  23. $criteria->limit = 20;
  24. return $this->findAll($criteria);
  25. /* $pager->pageSize = 20;
  26. $pager->applyLimit($criteria);
  27. $data['result']=$this->findAll($criteria);
  28. $data['page']=$pager;
  29. $data['page_total']= $total;
  30. return $data; */
  31. }
  32. }