增加下赛季倒计时

This commit is contained in:
hujiabin 2023-05-26 15:44:54 +08:00
parent 78f7fad29f
commit 22f6f43749
5 changed files with 43 additions and 1 deletions

View File

@ -38,12 +38,18 @@ class RankingController extends BaseAuthedController {
}else{
$this->_setV(TN_RANK_STATUS, 1, 0);
}
$countdown = 0;
$nextCurrSeasonMeta = mt\RankSeason::getNextCurrentSeason();
if ($nextCurrSeasonMeta){
$countdown = strtotime($nextCurrSeasonMeta['start_time']) - myself()->_getNowTime();
}
$rank_status = $this->_getV(TN_RANK_STATUS, 0 );
$is_rank = $this->_getV(TN_RANK_STATUS, 1 );
$this->_rspData(array(
'status' => $rank_status, // 0:常规状态 1:引导初始排位 2:赛季初,需结算上个赛季
'is_rank' => $is_rank //赛季是否空挡期
'is_rank' => $is_rank, //赛季是否空挡期 1:赛季开始了 0:赛季未开始
'countdown' => $countdown //下赛季倒计时
));
}

10
webapp/models/SignLog.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace models;
class SignLog
{
}

View File

@ -30,6 +30,22 @@ class RankSeason
return null;
}
public static function getNextCurrentSeason()
{
$metaList = self::getMetaList();
foreach ($metaList as $key => $meta) {
if ($key == 0 && myself()->_getNowTime() <= strtotime($meta['start_time'])) {
return $meta;
}
if ($key > 0 &&
myself()->_getNowTime() >= strtotime($metaList[$key-1]['end_time']) &&
myself()->_getNowTime() <= strtotime($metaList[$key]['start_time'])) {
return $meta;
}
}
return null;
}
public static function getSeasonByTime($time)
{
foreach (self::getMetaList() as $meta) {

10
webapp/mt/Sign.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace mt;
class Sign
{
}