Skip to content

Commit

Permalink
Fix grouping columns in stats query
Browse files Browse the repository at this point in the history
  • Loading branch information
henrist committed Jul 10, 2024
1 parent a95a908 commit 5d8ac43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/app/src/Billett/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function getStats($eventgroup_id)
FROM tickets t
JOIN events e ON t.event_id = e.id
WHERE t.is_valid = 1 AND e.eventgroup_id = ?
GROUP BY DATE(FROM_UNIXTIME(t.time)), ticketgroup_id, event_id
GROUP BY 1, 2, 3
UNION ALL
Expand All @@ -37,7 +37,7 @@ public static function getStats($eventgroup_id)
FROM tickets t
JOIN events e ON t.event_id = e.id
WHERE t.is_revoked = 1 AND e.eventgroup_id = ?
GROUP BY DATE(FROM_UNIXTIME(t.time)), ticketgroup_id, event_id
GROUP BY 1, 2, 3
UNION ALL
Expand All @@ -46,7 +46,7 @@ public static function getStats($eventgroup_id)
FROM ticketgroups tg JOIN events e ON e.id = tg.event_id
WHERE e.eventgroup_id = ? AND (tg.use_office != 0 OR tg.use_web != 0)
) ref
GROUP BY day, ticketgroup_id, event_id', [$eventgroup_id, $eventgroup_id, $eventgroup_id]);
GROUP BY 1, 2, 3', [$eventgroup_id, $eventgroup_id, $eventgroup_id]);

$ticketgroups = [];
$events = [];
Expand Down

0 comments on commit 5d8ac43

Please sign in to comment.