select = $select; $criteria->addCondition($condition); $result = $this->findAll($criteria); if($result){ $info = getAttributes($result); }else{ $info = array(); } return $info; } /** * 获取班级名称 * @param $classId * @return string */ public function getClassName($classId){ $sql = "select class_name from class where class_id = {$classId}"; return (string)$this->getCommandBuilder()->createSqlCommand($sql)->queryScalar(); } public function getClassInfo($classId){ $sql = "select class_name,grade,class_id from class where class_id = {$classId}"; return $this->getCommandBuilder()->createSqlCommand($sql)->queryRow(); } }