StudentImproveScorePlan.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * 学生提分册模型类
  4. * @author jiangfei
  5. * @date 2015-08-17 18:28:00
  6. * @company 上海风车教育有限公司.
  7. */
  8. class StudentImproveScorePlan extends MyActiveRecord{
  9. public static function model($className = __CLASS__){
  10. return parent::model($className);
  11. }
  12. public function tableName(){
  13. return "student_improve_score_plan";
  14. }
  15. public function getReportDataByPlanId($planId){
  16. $result = FALSE;
  17. if ($planId AND is_numeric($planId)) {
  18. $detail = $this->find('plan_id=:plid',array(':plid'=>$planId));
  19. if ($detail && $detail['report_created'] && $detail['report_data']){
  20. $result = json_decode($detail['report_data'], TRUE);
  21. }
  22. }
  23. return $result;
  24. }
  25. // 根据学生ids、paperid获取提分册
  26. public function getPlansByPaperIdSids($paperId,$studentIds) {
  27. $result = array();
  28. if ($paperId && is_numeric($paperId) && $studentIds && is_array($studentIds)){
  29. $criteria = new CDbCriteria();
  30. $criteria->addCondition("paper_id = '". $paperId ."' AND student_id IN (". implode(',', $studentIds) .")");
  31. $result = $this->findAll($criteria);
  32. }
  33. return $result;
  34. }
  35. }