1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- //下载任务打包表
- /**
- * This is the model class for table "task".
- *
- *
- * @property int $id 自增id
- * @property string $school_id 学校id
- * @property string $auth_username 学校id
- * @property int $product_type 产品类型 1错题本 2二步 3三步 4阶段复习 5二轮 6好题本 7微产品 8假期报告 9晨读词汇 10外刊宝
- * @property int $subject_id 科目id
- * @property int $class_id 班级id
- * @property int $class_name 班级名称
- * @property string $unique_key 唯一键
- * @property string $product_name 产品名称
- * @property string $student_count 人数
- * @property string $pack_json 打包json参数
- * @property string $pack_api_url 产品接口域名
- * @property string $pack_status 打包状态 0打包中 1打包完成 2打包失败 3已复制
- * @property string $pack_exception 打包异常
- * @property string $pack_url 压缩包下载地址
- * @property int $complete_time 完成时间
- * @property int $status 数据状态 1正常 0无效
- * @property int $create_time 创建时间
- */
- class BusinessPackProductTask extends BusinessActiveRecord{
- public static function model($className = __CLASS__){
- return parent::model($className);
- }
- public function tableName(){
- return "pack_product_task";
- }
- public function getList($schoolId,$page=1,$pageLimit=10)
- {
- $offset=($page-1)*$pageLimit;
- $pages=array();
- $totalQuery=$this->getDbConnection()->createCommand("select count(*) as count from pack_product_task where status=1 and school_id={$schoolId}")->queryRow();
- $pages['total']=$totalQuery['count'];
- $pages['totalPage']=ceil($totalQuery['count']/$pageLimit);
- $pages['page']=$page;
- $data = $this->getDbConnection()->createCommand("
- select *
- from pack_product_task
- where school_id={$schoolId} and status=1
- order by create_time desc
- limit {$offset},{$pageLimit}
-
- ")->queryAll();
- $return['pages']=$pages;
- $return['dataList']=$data;
- return $return;
- }
- }
|