🌳
pt0/gamesapp/binF/fetchGamesCountPerDeployAI.mts
3export const fetchGamesCountPerDeploy = (opts: { ep?: string; appConfig?: any }) =>
5 ...opts,
6 queryFnc: async (db, startTs, endTs) => {
7 let q = db('dbgames').where({ is_finished: true }).where('created_at', '>=', startTs)
8 if (endTs) q = q.where('created_at', '<', endTs)
9 const [{ count }] = await q.count('* as count')
10 return Number(count) || 0
11 },
12 })