From 5c2369ff47359b51432adb2ac75986e92ce32ba0 Mon Sep 17 00:00:00 2001 From: ZhenYi <434836402@qq.com> Date: Thu, 30 Apr 2026 19:39:26 +0800 Subject: [PATCH] fix(billing): correct monthly usage calculation query --- libs/service/workspace/alert.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/service/workspace/alert.rs b/libs/service/workspace/alert.rs index 37852ea..059ae1b 100644 --- a/libs/service/workspace/alert.rs +++ b/libs/service/workspace/alert.rs @@ -238,7 +238,7 @@ impl AppService { .map(|d| chrono::TimeZone::from_utc_datetime(&chrono::Utc, &d)) .unwrap_or(now); - workspace_billing_history::Entity::find() + let month_used: f64 = workspace_billing_history::Entity::find() .filter(workspace_billing_history::Column::WorkspaceId.eq(workspace_id)) .filter(workspace_billing_history::Column::Reason.like("ai_usage%")) .filter(workspace_billing_history::Column::CreatedAt.gte(month_start))