SMathReviewSetting.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /**
  3. * @author: CeeFee
  4. * @description: 考试
  5. */
  6. class SMathReviewSetting extends Model {
  7. function __construct(){
  8. parent::__construct();
  9. }
  10. //七天内二轮提分手册
  11. public function getMathReview(){
  12. $time=time()-86400*7;
  13. $sql="select name,class_id,grade,mr_id,mr_group_id,`name`,create_time from math_review_setting where create_time>'{$time}'";
  14. $data=$this->sConn->createCommand($sql)->queryAll();
  15. $result=array();
  16. if($data){
  17. foreach ($data as $val){
  18. $sql = "select review_download_time from math_review_student where mr_id = '{$val['mr_id']}' and is_review_download = 1 limit 1";
  19. $isDownArr = $this->sConn->createCommand($sql)->queryRow();
  20. if($isDownArr){
  21. $classInfo=$this->sConn->createCommand("select class_name from class where class_id='{$val['class_id']}'")->queryRow();
  22. $result[]=array(
  23. 'classId'=>$val['class_id'],
  24. 'className'=>$classInfo['class_name'],
  25. 'productName'=>'二轮提分指导手册 ',
  26. 'productType'=>3,
  27. 'id'=>$val['mr_group_id'],
  28. 'grade'=>$val['grade'],
  29. 'subject'=>3,
  30. 'name'=>$val['name'],
  31. 'time'=>$val['create_time']
  32. );
  33. }
  34. }
  35. }
  36. return $result;
  37. }
  38. /*
  39. * 查询英语晨读词汇
  40. *
  41. */
  42. public function getEnglishWeek(){
  43. $time=time()-86400*7;
  44. $result=array();
  45. $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}'";
  46. $data=$this->sConn->createCommand($sql)->queryAll();
  47. if($data){
  48. foreach ($data as $val){
  49. $result[]=array(
  50. 'id'=>$val['week_group_id'],
  51. 'classId'=>$val['class_id'],
  52. 'className'=>$val['class_name'],
  53. 'productName'=>'晨读词汇 ',
  54. 'productType'=>5,
  55. 'subject'=>8,
  56. 'name'=>$val['name'],
  57. 'grade'=>$val['grade'],
  58. 'time'=>$val['create_time']
  59. );
  60. }
  61. }
  62. return $result;
  63. }
  64. /*
  65. * 查询英语外刊阅读
  66. *
  67. */
  68. public function getEnglishReading(){
  69. $time=time()-86400*7;
  70. $result=array();
  71. $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 ";
  72. $sql.=" left join class c on c.class_id = ew.class_id ";
  73. $sql.=" left join english_reading_setting ers on ers.reading_id=ew.reading_id ";
  74. $sql.=" where ew.create_time>'{$time}'";
  75. $data=$this->sConn->createCommand($sql)->queryAll();
  76. if($data){
  77. foreach ($data as $val){
  78. if($val['category']==1){
  79. $productType=10;
  80. }elseif($val['category']==2){
  81. if($val['product_type']==1){
  82. $productType=57;
  83. }elseif($val['product_type']==2){
  84. $productType=61;
  85. }elseif($val['product_type']==3){
  86. $productType=58;
  87. }
  88. }
  89. $result[]=array(
  90. 'id'=>$val['reading_id'],
  91. 'classId'=>$val['class_id'],
  92. 'className'=>$val['class_name'],
  93. 'productName'=>'英语外刊阅读 ',
  94. 'productType'=>$productType,
  95. 'subject'=>8,
  96. 'name'=>$val['name'],
  97. 'grade'=>$val['grade'],
  98. 'time'=>$val['create_time']
  99. );
  100. }
  101. }
  102. return $result;
  103. }
  104. }