umami/queries/analytics/pageview/getPageviews.js
2022-07-12 15:14:27 -07:00

20 lines
367 B
JavaScript

import { runQuery } from 'lib/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,
},
},
}),
);
}