Skip to content

Commit

Permalink
fix: model table
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed Jun 1, 2024
1 parent aaa4cb5 commit 698b2cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/service/hub/model/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (acc *Account) GetUsageByDate(ctx context.Context, since time.Time, until t
var logs []schema.UsageByDate

err := acc.databaseClient.WithContext(ctx).
Model(&schema.UsageByDate{}).
Model(&table.GatewayConsumptionLog{}).
Joins("LEFT JOIN key ON consumption_log.key_id = key.id").
Where("account_address = ? AND consumption_date BETWEEN ? AND ?", acc.Address, since, until).
Select("SUM(ru_used) AS ru_used, SUM(api_calls) AS api_calls, (EXTRACT(EPOCH FROM consumption_date)*1000)::BIGINT AS consumption_timestamp").
Expand Down

0 comments on commit 698b2cd

Please sign in to comment.