diff --git a/docs/00-overview.md b/docs/00-overview.md index a98abfc..77c0722 100644 --- a/docs/00-overview.md +++ b/docs/00-overview.md @@ -1,4 +1,4 @@ -# 学生管理系统 — 项目总览 +# 教育培训管理系统 — 项目总览 > 本文档汇总学生管理系统的架构、业务、数据库及运维部署设计,作为项目开发和维护的参考基准。 diff --git a/pyproject.toml b/pyproject.toml index ade1bd4..786c0c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "student-manage-system" version = "0.1.0" -description = "Add your description here" +description = "教培系统架构设计与开发" readme = "README.md" requires-python = ">=3.13" dependencies = [ diff --git a/routers/stats.py b/routers/stats.py index ea70f0e..f795daa 100644 --- a/routers/stats.py +++ b/routers/stats.py @@ -44,12 +44,16 @@ def score_stats(class_id: Optional[int] = None, score_num: Optional[str] = None, db.query( Score.num.label("score_num"), Student.class_id, + Class.num.label("class_num"), + Class.name.label("class_name"), func.avg(Score.score).label("avg_score"), func.max(Score.score).label("max_score"), func.min(Score.score).label("min_score"), func.count(Score.id).label("count"), ) .join(Student, Score.sid == Student.id) + # 添加班级名称 + .join(Class, Student.class_id == Class.id) .filter(Student.is_deleted == False, Score.is_deleted == False) .group_by(Score.num, Student.class_id) ) @@ -62,6 +66,8 @@ def score_stats(class_id: Optional[int] = None, score_num: Optional[str] = None, { "score_num": r.score_num, "class_id": r.class_id, + "class_num": r.class_num, + "class_name": r.class_name, "avg_score": float(r.avg_score), "max_score": float(r.max_score), "min_score": float(r.min_score), diff --git a/sms.db b/sms.db index 259ef1c..a417285 100644 Binary files a/sms.db and b/sms.db differ diff --git a/static/index.html b/static/index.html index 332f8a2..9214fb4 100644 --- a/static/index.html +++ b/static/index.html @@ -3,7 +3,7 @@ - 学生管理系统 + 教育培训管理系统