Convert billing to 1-to-100 credits

This commit is contained in:
stringadmin
2026-06-08 15:46:28 +08:00
parent 855fdfc4ff
commit fdd408d06b
8 changed files with 98 additions and 53 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ async function getAverageCostCents(provider) {
const { rows } = await pool.query(
`
SELECT CAST(ROUND(AVG(CASE
WHEN cost_estimate IS NOT NULL THEN cost_estimate * 100
WHEN cost_estimate IS NOT NULL THEN cost_estimate * 10000
ELSE 0
END)::numeric) AS INTEGER) AS avg_cents
FROM api_call_logs