diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index eb538f57f..16b90a647 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -344,12 +344,12 @@ SELECT showt.name AS show_name, JOIN cc_show AS showt ON (showt.id = si.show_id) WHERE si.modified_instance = FALSE $showPredicate - AND (si.starts >= '{$p_start}' + AND ((si.starts >= '{$p_start}' AND si.starts < '{$p_end}') OR (si.ends > '{$p_start}' AND si.ends <= '{$p_end}') OR (si.starts <= '{$p_start}' - AND si.ends >= '{$p_end}') + AND si.ends >= '{$p_end}')) ORDER BY si_starts, sched_starts; SQL;