match cloud stats in self hosted

This commit is contained in:
Maxime-J 2023-11-02 17:34:06 +00:00
parent 8a4623eb7b
commit 76a5ac8e46
3 changed files with 20 additions and 16 deletions

View file

@ -35,7 +35,7 @@ async function relationalQuery(
}[]
> {
const { windowMinutes, startDate, endDate, urls } = criteria;
const { rawQuery, getAddMinutesQuery } = prisma;
const { rawQuery, getAddIntervalQuery } = prisma;
const { levelQuery, sumQuery } = getFunnelQuery(urls, windowMinutes);
function getFunnelQuery(
@ -58,9 +58,9 @@ async function relationalQuery(
join website_event we
on l.session_id = we.session_id
where we.website_id = {{websiteId::uuid}}
and we.created_at between l.created_at and ${getAddMinutesQuery(
and we.created_at between l.created_at and ${getAddIntervalQuery(
`l.created_at `,
windowMinutes,
`${windowMinutes} minute`,
)}
and we.referrer_path = {{${i - 1}}}
and we.url_path = {{${i}}}