修改排位赛空档期
This commit is contained in:
parent
129d947477
commit
175e93d96b
@ -39,6 +39,9 @@ class SeasonController extends BaseAuthedController {
|
||||
{
|
||||
parent::_handlePre();
|
||||
$this->currRankSeasonMeta = mt\RankSeason::getCurrentSeason();
|
||||
if (!$this->currRankSeasonMeta) {
|
||||
$this->currRankSeasonMeta = mt\RankSeason::getLastSeason();
|
||||
}
|
||||
if (!$this->currRankSeasonMeta) {
|
||||
$this->_rspErr(10, 'server internal error');
|
||||
die();
|
||||
|
@ -19,6 +19,23 @@ class RankSeason
|
||||
return self::$metaList;
|
||||
}
|
||||
|
||||
public static function getLastSeason()
|
||||
{
|
||||
$metaList = self::getMetaList();
|
||||
$count = count($metaList);
|
||||
foreach ($metaList as $key => $meta) {
|
||||
if (myself()->_getNowTime() >= strtotime($metaList[$key]['end_time']) &&
|
||||
myself()->_getNowTime() <= strtotime($metaList[$key+1]['start_time'])) {
|
||||
return $meta;
|
||||
}
|
||||
if ($key == $count && myself()->_getNowTime() >= strtotime($meta['end_time'])) {
|
||||
return $meta;
|
||||
}
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
public static function getCurrentSeason()
|
||||
{
|
||||
foreach (self::getMetaList() as $meta) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user