addCondition("class_id = '". $classId ."' AND paper_id = '". $paperId ."'"); $result = getAttributes($this->findAll($criteria)); } return $result; } public function getStudentIdsByClassId_PaperId($classId, $paperId) { $relations = $this->getRelationsByClassId_PaperId($classId, $paperId); $result = array(); if ($relations) { foreach ($relations AS $relation) { $result[] = $relation['student_id']; } } return $result ? array_unique($result) : $result; } /** * 获取试卷题信息 * @param $examIds * @return array|CDbDataReader */ public function getStudentExamInfo($examIds){ $info = array(); if($examIds){ $sql = "select student_id,is_del,paper_id,exam_id,scoring,is_feedback,is_three_isp_download,is_two_isp_download from ".$this->tableName()." where exam_id in (".implode(',',$examIds).") "; $info = $this->getCommandBuilder()->createSqlCommand($sql)->queryAll(); if($info){ return $info; } } return $info; } /** * 获取试卷题信息 * @param $examIds * @return array|CDbDataReader */ public function getStudentFeedBack($examIds){ if($examIds){ $sql = "select is_feedback from ".$this->tableName()." where exam_id in (".implode(',',$examIds).") and is_feedback=1 limit 1"; $info = $this->getCommandBuilder()->createSqlCommand($sql)->queryRow(); if($info){ return true; } } return false; } }