v2.5更新

This commit is contained in:
2026-05-29 17:35:29 +08:00
parent 6c0d8f0e94
commit fe58ee1d23
12 changed files with 258 additions and 24 deletions

View File

@@ -213,7 +213,8 @@ class ConductService:
end_date: Optional[str] = None,
grouped: bool = False,
related_type: Optional[str] = None,
reason_prefix: Optional[str] = None
reason_prefix: Optional[str] = None,
is_revoked: Optional[int] = None
) -> Dict[str, Any]:
"""获取历史记录"""
# 空字符串转为None
@@ -251,7 +252,8 @@ class ConductService:
end_date=end_date,
student_id=student_id,
related_type=related_type,
reason_prefix=reason_prefix
reason_prefix=reason_prefix,
is_revoked=is_revoked
)
# 获取总数
@@ -273,6 +275,9 @@ class ConductService:
if reason_prefix:
count_conditions.append("cr.reason LIKE %s")
count_params.append(f"{reason_prefix}%")
if is_revoked is not None:
count_conditions.append("cr.is_revoked = %s")
count_params.append(1 if is_revoked else 0)
count_where = " AND ".join(count_conditions)
count_sql = f"""
SELECT COUNT(*) as total FROM conduct_records cr