umami/queries/analytics/pageview/getPageviews.js

20 lines
363 B
JavaScript
Raw Normal View History

2022-07-12 23:14:36 +02:00
import { runQuery } from 'queries';
import prisma from 'lib/db';
export async function getPageviews(websites, start_at) {
return runQuery(
prisma.pageview.findMany({
where: {
website: {
website_id: {
in: websites,
},
},
created_at: {
gte: start_at,
},
},
}),
);
}