feat: implement proxy billing details handling and resolveProxyLogBilling function

This commit is contained in:
cita
2026-03-06 18:28:45 +08:00
parent 3748e6dcb6
commit e88fc0a997
11 changed files with 380 additions and 217 deletions
+5 -1
View File
@@ -200,7 +200,11 @@ export async function statsRoutes(app: FastifyInstance) {
.leftJoin(schema.sites, eq(schema.accounts.siteId, schema.sites.id))
.orderBy(desc(schema.proxyLogs.createdAt))
.limit(limit).offset(offset).all()
), { includeBillingDetails: true });
), { includeBillingDetails: true }) as Array<{
proxy_logs: Record<string, unknown> & { billingDetails?: string | null };
accounts: { username?: string | null } | null;
sites: { name?: string | null; url?: string | null } | null;
}>;
return rows.map((row) => ({
...row.proxy_logs,