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: