更新v1.4版本,修复了一些已知问题
This commit is contained in:
@@ -40,6 +40,21 @@ class ConductModel:
|
||||
student_id, points_change, reason, recorder_id, recorder_name, related_type, related_id
|
||||
))
|
||||
|
||||
@staticmethod
|
||||
async def count_student_records(student_id: int, include_revoked: bool = False) -> int:
|
||||
"""统计学生操行分记录总数"""
|
||||
revoked_condition = "" if include_revoked else " AND is_revoked = 0"
|
||||
sql = f"SELECT COUNT(*) as total FROM conduct_records WHERE student_id = %s{revoked_condition}"
|
||||
result = await execute_one(sql, (student_id,))
|
||||
return result["total"] if result else 0
|
||||
|
||||
@staticmethod
|
||||
async def count_records_by_recorder(recorder_id: int) -> int:
|
||||
"""统计记录人提交的操行分记录总数"""
|
||||
sql = "SELECT COUNT(*) as total FROM conduct_records WHERE recorder_id = %s"
|
||||
result = await execute_one(sql, (recorder_id,))
|
||||
return result["total"] if result else 0
|
||||
|
||||
@staticmethod
|
||||
async def get_student_records(
|
||||
student_id: int,
|
||||
|
||||
Reference in New Issue
Block a user