'{$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; } }