From 4529bf6857330a910ee71e4ced05e83445536d01 Mon Sep 17 00:00:00 2001 From: Ludek Novy <13610612+ludeknovy@users.noreply.github.com> Date: Fri, 4 Oct 2024 08:46:09 +0200 Subject: [PATCH] Dashboard stats query fix (#344) --- src/server/queries/items.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/queries/items.ts b/src/server/queries/items.ts index 8f8a73a..202f51c 100644 --- a/src/server/queries/items.ts +++ b/src/server/queries/items.ts @@ -157,8 +157,8 @@ export const dashboardStats = () => { return { text: ` SELECT round(AVG((overview -> 'maxVu')::int)) as "avgVu", - round(AVG((overview -> 'duration')::int)) as "avgDuration", - round(SUM((overview -> 'duration')::int)) as "totalDuration", + round(AVG((overview -> 'duration')::bigInt)) as "avgDuration", + round(SUM((overview -> 'duration')::bigInt)) as "totalDuration", count(*) as "totalCount" from jtl.item_stat as stat LEFT JOIN jtl.items as items ON items.id = stat.item_id WHERE items.report_status = 'ready';`,