SStudentModelEssay.php 869 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2019/11/11 0011
  6. * Time: 14:00
  7. */
  8. class SStudentModelEssay extends MyActiveRecord
  9. {
  10. public static function model($className = __CLASS__)
  11. {
  12. return parent::model($className);
  13. }
  14. public function tableName()
  15. {
  16. return 'student_model_essay';
  17. }
  18. /**
  19. * 获取学生精品范文答题id
  20. * @param $exam_id
  21. * @return array
  22. */
  23. public function getStuRsId($exam_id)
  24. {
  25. $stu_rs_ids = array();
  26. $criteria = new CDbCriteria();
  27. $criteria->addCondition("exam_id = '". $exam_id ."'");
  28. $sme_info = getAttributes($this->findAll($criteria));
  29. if($sme_info){
  30. foreach($sme_info as $value){
  31. $stu_rs_ids[] = $value['sptr_id'];
  32. }
  33. }
  34. return $stu_rs_ids;
  35. }
  36. }