From 22f6f43749b980dfab4be28effce35b3d5270fe5 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Fri, 26 May 2023 15:44:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8B=E8=B5=9B=E5=AD=A3?= =?UTF-8?q?=E5=80=92=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/controller/RankingController.class.php | 8 +++++++- webapp/controller/SignController.class.php | 0 webapp/models/SignLog.php | 10 ++++++++++ webapp/mt/RankSeason.php | 16 ++++++++++++++++ webapp/mt/Sign.php | 10 ++++++++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 webapp/controller/SignController.class.php create mode 100644 webapp/models/SignLog.php create mode 100644 webapp/mt/Sign.php diff --git a/webapp/controller/RankingController.class.php b/webapp/controller/RankingController.class.php index 7338f88b..3a1e2a7d 100644 --- a/webapp/controller/RankingController.class.php +++ b/webapp/controller/RankingController.class.php @@ -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 //下赛季倒计时 )); } diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php new file mode 100644 index 00000000..e69de29b diff --git a/webapp/models/SignLog.php b/webapp/models/SignLog.php new file mode 100644 index 00000000..b17d2cc9 --- /dev/null +++ b/webapp/models/SignLog.php @@ -0,0 +1,10 @@ + $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) { diff --git a/webapp/mt/Sign.php b/webapp/mt/Sign.php new file mode 100644 index 00000000..88c8987a --- /dev/null +++ b/webapp/mt/Sign.php @@ -0,0 +1,10 @@ +