fix(billing): correct monthly usage calculation query
This commit is contained in:
parent
3e540a5302
commit
5c2369ff47
@ -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))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user