From f1487ba69da86257645716e1578443d185891c6b Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 7 Sep 2012 17:23:32 -0400 Subject: [PATCH] cc-4347: Fixed missing AND clause --- airtime_mvc/application/models/Show.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index 9faab43e2..a41345065 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1638,9 +1638,11 @@ SQL; ':end' => $end_string ), 'all'); } else { - $sql .= " AND ((si1.starts >= :start1::TIMESTAMP AND si1.starts < :end1::TIMESTAMP) - OR (si1.ends > :start2::TIMESTAMP si1.ends <= :end2::TIMESTAMP) - OR (si1.starts <= :start3::TIMESTAMP AND si1.ends >= :end3::TIMESTAMP))"; + $sql .= " ". <<= :start1::TIMESTAMP AND si1.starts < :end1::TIMESTAMP) + OR (si1.ends > :start2::TIMESTAMP AND si1.ends <= :end2::TIMESTAMP) + OR (si1.starts <= :start3::TIMESTAMP AND si1.ends >= :end3::TIMESTAMP)) +SQL; return Application_Common_Database::prepareAndExecute( $sql, array( 'start1' => $start_string,