-further modifications to now-playing view with grouping by shows

This commit is contained in:
martin 2011-03-04 23:53:29 -05:00
parent 38856c4af7
commit cb119802df
6 changed files with 119 additions and 84 deletions

View file

@ -768,7 +768,9 @@ class Show_DAL{
." $CC_CONFIG[showInstances] si,"
." $CC_CONFIG[showTable] s"
." WHERE si.show_id = s.id"
." AND (si.ends > TIMESTAMP '$timeNow' - INTERVAL '$start seconds' OR si.starts < TIMESTAMP '$timeNow' + INTERVAL '$end seconds')"
." AND ((si.starts < TIMESTAMP '$timeNow' - INTERVAL '$start seconds' AND si.ends > TIMESTAMP '$timeNow' - INTERVAL '$start seconds')"
." OR (si.starts > TIMESTAMP '$timeNow' - INTERVAL '$start seconds' AND si.ends < TIMESTAMP '$timeNow' + INTERVAL '$end seconds')"
." OR (si.starts < TIMESTAMP '$timeNow' + INTERVAL '$end seconds' AND si.ends > TIMESTAMP '$timeNow' + INTERVAL '$end seconds'))"
." ORDER BY si.starts";
$rows = $CC_DBC->GetAll($sql);