diff --git a/routes/publishedSchedule.js b/routes/publishedSchedule.js index a0ba8f3..099c46c 100644 --- a/routes/publishedSchedule.js +++ b/routes/publishedSchedule.js @@ -246,12 +246,12 @@ publishedScheduleRouter.get('/stats', async (req, res) => { SELECT COALESCE(ap.event_type::text, 'Total') AS event_type, COALESCE(ap.subject::text, 'Total') AS subject, - COALESCE(COUNT(c.catalog_id), 0) AS total_count + COALESCE(COUNT(DISTINCT ps_event_id), 0) AS total_count FROM all_permutations ap LEFT JOIN ( SELECT *, ps.day_id AS ps_day_id, - c.id AS catalog_id + ps.id AS ps_event_id FROM catalog c JOIN published_schedule ps ON c.id = ps.event_id JOIN day d ON PS.day_id = d.id