fix(billing): correct monthly usage calculation query
Some checks are pending
CI / Rust Lint & Check (push) Waiting to run
CI / Rust Tests (push) Waiting to run
CI / Frontend Lint & Type Check (push) Waiting to run
CI / Frontend Build (push) Blocked by required conditions

This commit is contained in:
ZhenYi 2026-04-30 19:39:26 +08:00
parent 3e540a5302
commit 5c2369ff47

View File

@ -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))