getDbConnection()->createCommand($sql)->queryAll(); return $data; } public function getCountByExamId($examId){ if(!$examId ){ return false; } $sql="select count(*) as count from student_answer_card_online where exam_id='".$examId."' and answer_card_online_created=1"; $data=$this->getDbConnection()->createCommand($sql)->queryRow(); return $data; } public function countStudentCreateCount($examIds){ if(!$examIds || !is_array($examIds)){ return false; } $sql="select count(*) as count from student_answer_card_online where exam_id in(".implode(',',$examIds).") and answer_card_online_created=1"; $data=$this->getDbConnection()->createCommand($sql)->queryRow(); if($data){ return $data[0]; }else{ return 0; } } }