12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * @author: CeeFee
- * @description: 考试
- */
- class SExamRestore extends MyActiveRecord {
- public static function model($className = __CLASS__)
- {
- return parent::model($className);
- }
- public function tableName()
- {
- return 'exam_restore';
- }
- public function getList($examName,$page,$pageLimit){
- $result=array();
- $where =" is_del = 0 ";
- if($examName){
- $where.=" And exam_name like '%".$examName."%' ";
- }
- $connect = $this->getDbConnection();
- $dataCount = $connect->createCommand()
- ->from('exam_restore')
- ->where($where)
- ->query()
- ->count();
- $result['totalCount']=$dataCount;
- $result['pageTotal']=ceil($dataCount/$pageLimit);
- $offset=($page-1)*$pageLimit;
- $data=$connect->createCommand()
- ->from('exam_restore')
- ->where($where)
- ->offset($offset)
- ->limit($pageLimit)
- ->order('create_time desc')
- ->query()
- ->readAll();
- $result['data']=$data;
- return $result;
- }
- }
|