mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix: return end user top spend
This commit is contained in:
parent
1788c894f2
commit
7cfcaa9556
2 changed files with 80 additions and 44 deletions
|
@ -601,7 +601,7 @@ class PrismaClient:
|
|||
except Exception as e:
|
||||
sql_query = """
|
||||
CREATE VIEW "Last30dTopEndUsersSpend" AS
|
||||
SELECT end_user, SUM(spend) AS total_spend
|
||||
SELECT end_user, COUNT(*) AS total_events, SUM(spend) AS total_spend
|
||||
FROM "LiteLLM_SpendLogs"
|
||||
WHERE end_user <> '' AND end_user <> user
|
||||
AND "startTime" >= CURRENT_DATE - INTERVAL '30 days'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue