CC-3449: Live Stream: Kick out live dj at the end of the show
- PHP side implementation
This commit is contained in:
parent
24260e8908
commit
f8d3a8c8bb
3 changed files with 26 additions and 1 deletions
|
@ -827,4 +827,20 @@ class Application_Model_ShowInstance {
|
|||
$sql = "SELECT count(*) as cnt FROM $CC_CONFIG[showInstances] WHERE ends < '$day'";
|
||||
return $CC_DBC->GetOne($sql);
|
||||
}
|
||||
|
||||
// this returns end timestamp of next show that has live DJ set up
|
||||
public static function GetEndTimeOfNextShowWithLiveDJ(){
|
||||
global $CC_CONFIG, $CC_DBC;
|
||||
|
||||
$date = new Application_Model_DateHelper;
|
||||
$utcTimeNow = $date->getUtcTimestamp();
|
||||
|
||||
$sql = "SELECT ends
|
||||
FROM cc_show_instances as si
|
||||
JOIN cc_show as sh ON si.show_id = sh.id
|
||||
WHERE si.ends > '$utcTimeNow' and (sh.live_stream_using_airtime_auth or live_stream_using_custom_auth)
|
||||
ORDER BY si.ends";
|
||||
|
||||
return $CC_DBC->GetOne($sql);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue