From 8bfd5aa3de6813698a3b4df0a62df9598779d8d4 Mon Sep 17 00:00:00 2001 From: yuliang_guo Date: Mon, 2 Feb 2026 13:02:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DTrainingSession?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=AF=94=E8=BE=83=E5=A4=A7=E5=B0=8F=E5=86=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - COMPLETED -> completed (枚举值是小写) --- backend/app/services/dashboard_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/services/dashboard_service.py b/backend/app/services/dashboard_service.py index c1ef4fc..3be2ccc 100644 --- a/backend/app/services/dashboard_service.py +++ b/backend/app/services/dashboard_service.py @@ -103,7 +103,7 @@ class DashboardService: try: result = await self.db.execute( select(func.coalesce(func.sum(TrainingSession.duration_seconds), 0)) - .where(TrainingSession.status == 'COMPLETED') + .where(TrainingSession.status == 'completed') # 修复: 使用小写 ) training_hours = (result.scalar() or 0) / 3600 except Exception as e: