From 23dd6d402144baaf0f36154d2b0171931f8db79c Mon Sep 17 00:00:00 2001 From: Albert Santoni Date: Mon, 8 Jun 2015 16:38:17 -0400 Subject: [PATCH] CC-6054: live-info-v2 returns future shows without ordering by start time --- airtime_mvc/application/models/Show.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index f96ad7ee0..e5eca649f 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1157,13 +1157,13 @@ WHERE si.show_id = s.id AND si.starts >= :timeNow::timestamp - INTERVAL '2 days' AND si.starts < :timeEnd::timestamp AND modified_instance != TRUE -ORDER BY - CASE +ORDER BY + CASE WHEN si.ends > :timeNow::timestamp AND si.starts < :timeNow::timestamp THEN 1 WHEN si.starts > :timeNow::timestamp THEN 2 ELSE 3 - END + END, si.starts LIMIT :lim SQL;