v2.2更新
This commit is contained in:
@@ -53,6 +53,18 @@ class StudentModel:
|
||||
sql += " ORDER BY student_no"
|
||||
return await execute_query(sql)
|
||||
|
||||
@staticmethod
|
||||
async def get_dormitory_list() -> List[str]:
|
||||
"""获取所有不重复的宿舍号列表"""
|
||||
sql = """
|
||||
SELECT DISTINCT dormitory_number
|
||||
FROM students
|
||||
WHERE status = 1 AND dormitory_number IS NOT NULL AND dormitory_number != ''
|
||||
ORDER BY dormitory_number
|
||||
"""
|
||||
rows = await execute_query(sql)
|
||||
return [row["dormitory_number"] for row in rows]
|
||||
|
||||
@staticmethod
|
||||
async def create(
|
||||
student_no: str,
|
||||
|
||||
Reference in New Issue
Block a user