mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 01:55:36 +01:00
WebsiteId query param. Fix Prisma filters.
This commit is contained in:
parent
f654e6728c
commit
b4bd988e4e
10 changed files with 62 additions and 46 deletions
|
|
@ -11,16 +11,18 @@ export async function getActiveVisitors(...args: [websiteId: string]) {
|
|||
}
|
||||
|
||||
async function relationalQuery(websiteId: string) {
|
||||
const date = subMinutes(new Date(), 5);
|
||||
const params = [date];
|
||||
const { toUuid, rawQuery } = prisma;
|
||||
|
||||
return prisma.rawQuery(
|
||||
const date = subMinutes(new Date(), 5);
|
||||
const params: any = [websiteId, date];
|
||||
|
||||
return rawQuery(
|
||||
`select count(distinct session_id) x
|
||||
from pageview
|
||||
from website_event
|
||||
join website
|
||||
on pageview.website_id = website.website_id
|
||||
where website.website_id = '${websiteId}'
|
||||
and pageview.created_at >= $1`,
|
||||
on website_event.website_id = website.website_id
|
||||
where website.website_id = $1${toUuid()}
|
||||
and website_event.created_at >= $2`,
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue