Skip to content

Commit

Permalink
fix: added webcast filter to dazzler group (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrannican authored Jul 25, 2024
1 parent 13a7d2b commit 1f10b42
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,19 +337,19 @@ public function findUpcomingUnderGroup(
*
* The rest of the query is obvious and deals with getting the relevant metadata around the core entity etc.
*/
$sql = 'SELECT ' . $selectClause ;
$sql = 'SELECT ' . $selectClause;
$sql .= <<<'EOQ'
FROM
(
SELECT cb.*
(
SELECT cb.*
FROM membership m
INNER JOIN collapsed_broadcast cb ON m.`member_core_entity_id` = cb.`programme_item_id`
WHERE m.group_id = :groupDbId AND cb.end_at > :cutoffTime
WHERE m.group_id = :groupDbId AND cb.end_at > :cutoffTime AND cb.is_webcast_only IS NOT 1
UNION
SELECT cb.*
SELECT cb.*
FROM membership m
INNER JOIN collapsed_broadcast cb ON m.`member_core_entity_id` = cb.`tleo_id`
WHERE m.group_id = :groupDbId AND cb.end_at > :cutoffTime
WHERE m.group_id = :groupDbId AND cb.end_at > :cutoffTime AND cb.is_webcast_only IS NOT 1
) AS cb
LEFT JOIN collapsed_broadcast cb2 ON cb.`programme_item_id` = cb2.`programme_item_id` AND cb.`end_at` > cb2.`end_at` AND cb2.end_at > :cutoffTime
INNER JOIN core_entity ce ON cb.`programme_item_id` = ce.id
Expand Down

0 comments on commit 1f10b42

Please sign in to comment.