deep voodoo magic to optimize schedule
This commit is contained in:
parent
58d00cb9b9
commit
8d56c03fe3
|
@ -1789,9 +1789,9 @@ SQL;
|
||||||
|
|
||||||
$showInstance = new Application_Model_ShowInstance(
|
$showInstance = new Application_Model_ShowInstance(
|
||||||
$show["instance_id"]);
|
$show["instance_id"]);
|
||||||
$showContent = $showInstance->getShowListContent();
|
//$showContent = $showInstance->getShowListContent();
|
||||||
|
|
||||||
$options["show_empty"] = empty($showContent) ? 1 : 0;
|
$options["show_empty"] = ($showInstance->showEmpty()) ? 1 : 0;
|
||||||
|
|
||||||
$events[] = &self::makeFullCalendarEvent($show, $options,
|
$events[] = &self::makeFullCalendarEvent($show, $options,
|
||||||
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
$startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
|
||||||
|
|
|
@ -661,6 +661,28 @@ SQL;
|
||||||
return $returnStr;
|
return $returnStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function showEmpty()
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT s.starts
|
||||||
|
FROM cc_schedule AS s
|
||||||
|
WHERE s.instance_id = :instance_id
|
||||||
|
AND s.playout_status >= 0
|
||||||
|
AND ((s.stream_id IS NOT NULL)
|
||||||
|
OR (s.file_id IS NOT NULL)) LIMIT 1
|
||||||
|
SQL;
|
||||||
|
# TODO : use prepareAndExecute properly
|
||||||
|
$res = Application_Common_Database::prepareAndExecute($sql,
|
||||||
|
array( ':instance_id' => $this->_instanceId ), 'all' );
|
||||||
|
# TODO : A bit retarded. fix this later
|
||||||
|
foreach ($res as $r) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function getShowListContent()
|
public function getShowListContent()
|
||||||
{
|
{
|
||||||
$con = Propel::getConnection();
|
$con = Propel::getConnection();
|
||||||
|
|
Loading…
Reference in New Issue