v0.6测试

This commit is contained in:
2026-04-14 19:18:11 +08:00
parent fd3535f884
commit a60ba8352f
23 changed files with 157 additions and 40 deletions

View File

@@ -109,14 +109,16 @@ class StudentModel:
async def get_ranking(limit: int = 50) -> List[Dict[str, Any]]:
"""获取学生排行(单班级)"""
sql = """
SELECT student_id, student_no, name, total_points,
RANK() OVER (ORDER BY total_points DESC) as rank
FROM students
SELECT student_id, student_no, name, total_points
FROM students
WHERE status = 1
ORDER BY total_points DESC
LIMIT %s
"""
return await execute_query(sql, (limit,))
results = await execute_query(sql, (limit,))
for i, row in enumerate(results):
row['rank'] = i + 1
return results
@staticmethod
async def batch_create(students_data: List[Dict], initial_points: int = 60) -> List[Dict]: