addCondition("group_id = '". $groupId ."'"); $result = getAttribute($this->find($criteria)); } return $result; } /** * 获取考试组是否是第三方的试卷 * @param $examGroupId * @param $examId * @return bool|int */ public function getExamIsTird($examGroupId,$examId){ if(!$examGroupId){ if($examId){ $_sql = "SELECT exam_group_id FROM exam where exam_id = ".$examId; $exam_info = $this->getCommandBuilder()->createSqlCommand($_sql)->queryRow(); if(isset($exam_info['exam_group_id']) && $exam_info['exam_group_id']){ $examGroupId = $exam_info['exam_group_id']; } } } $sql="SELECT `is_third` FROM `exam_group` WHERE exam_group_id = {$examGroupId}" ; $res = $this->getCommandBuilder()->createSqlCommand($sql)->queryRow(); if($res && isset($res['is_third'])){ return $res['is_third']?1:0; }else{ return false; } } }