123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- /**
- * @author: CeeFee
- * @description: 考试
- */
- class SMathReviewSetting extends Model {
- function __construct(){
- parent::__construct();
- }
- //七天内二轮提分手册
- public function getMathReview(){
- $time=time()-86400*7;
- $sql="select name,class_id,grade,mr_id,mr_group_id,`name`,create_time from math_review_setting where create_time>'{$time}'";
- $data=$this->sConn->createCommand($sql)->queryAll();
- $result=array();
- if($data){
- foreach ($data as $val){
- $sql = "select review_download_time from math_review_student where mr_id = '{$val['mr_id']}' and is_review_download = 1 limit 1";
- $isDownArr = $this->sConn->createCommand($sql)->queryRow();
- if($isDownArr){
- $classInfo=$this->sConn->createCommand("select class_name from class where class_id='{$val['class_id']}'")->queryRow();
- $result[]=array(
- 'classId'=>$val['class_id'],
- 'className'=>$classInfo['class_name'],
- 'productName'=>'二轮提分指导手册 ',
- 'productType'=>3,
- 'id'=>$val['mr_group_id'],
- 'grade'=>$val['grade'],
- 'subject'=>3,
- 'name'=>$val['name'],
- 'time'=>$val['create_time']
- );
- }
- }
- }
- return $result;
- }
- /*
- * 查询英语晨读词汇
- *
- */
- public function getEnglishWeek(){
- $time=time()-86400*7;
- $result=array();
- $sql="select week_group_id,c.class_id,c.class_name,name,c.grade,ew.create_time from english_week ew join class c on c.class_id = ew.class_id where ew.create_time>'{$time}'";
- $data=$this->sConn->createCommand($sql)->queryAll();
- if($data){
- foreach ($data as $val){
- $result[]=array(
- 'id'=>$val['week_group_id'],
- 'classId'=>$val['class_id'],
- 'className'=>$val['class_name'],
- 'productName'=>'晨读词汇 ',
- 'productType'=>5,
- 'subject'=>8,
- 'name'=>$val['name'],
- 'grade'=>$val['grade'],
- 'time'=>$val['create_time']
- );
- }
- }
- return $result;
- }
- /*
- * 查询英语外刊阅读
- *
- */
- public function getEnglishReading(){
- $time=time()-86400*7;
- $result=array();
- $sql="select ew.reading_id,c.class_id,c.class_name,name,c.grade,ew.create_time,ers.product_type,ers.category from english_reading ew ";
- $sql.=" left join class c on c.class_id = ew.class_id ";
- $sql.=" left join english_reading_setting ers on ers.reading_id=ew.reading_id ";
- $sql.=" where ew.create_time>'{$time}'";
- $data=$this->sConn->createCommand($sql)->queryAll();
- if($data){
- foreach ($data as $val){
- if($val['category']==1){
- $productType=10;
- }elseif($val['category']==2){
- if($val['product_type']==1){
- $productType=57;
- }elseif($val['product_type']==2){
- $productType=61;
- }elseif($val['product_type']==3){
- $productType=58;
- }
- }
- $result[]=array(
- 'id'=>$val['reading_id'],
- 'classId'=>$val['class_id'],
- 'className'=>$val['class_name'],
- 'productName'=>'英语外刊阅读 ',
- 'productType'=>$productType,
- 'subject'=>8,
- 'name'=>$val['name'],
- 'grade'=>$val['grade'],
- 'time'=>$val['create_time']
- );
- }
- }
- return $result;
- }
- }
|