fix(db): count rows broken

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-02-26 12:18:58 +01:00
parent 98d945c108
commit 80fa34469e

View File

@@ -203,7 +203,7 @@ export async function getOrganizationBillingEventsCount(
sb.select.count = 'COUNT(*) AS count';
sb.where.projectIds = `project_id IN (${organization.projects.map((project) => escape(project.id)).join(',')})`;
sb.where.createdAt = `BETWEEN ${escape(formatClickhouseDate(organization.subscriptionCurrentPeriodStart))} AND ${escape(formatClickhouseDate(organization.subscriptionCurrentPeriodEnd))}`;
sb.where.createdAt = `created_at BETWEEN ${escape(formatClickhouseDate(organization.subscriptionCurrentPeriodStart))} AND ${escape(formatClickhouseDate(organization.subscriptionCurrentPeriodEnd))}`;
const res = await chQuery<{ count: number }>(getSql());
return res[0]?.count;