From d6829971a4c5f918927dca5162c1fc73cf433275 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 22 Apr 2024 16:13:08 +0800 Subject: [PATCH] 1 --- webapp/controller/OtherController.class.php | 82 ++++++++++++--------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/webapp/controller/OtherController.class.php b/webapp/controller/OtherController.class.php index 257023a0..9156cbd1 100644 --- a/webapp/controller/OtherController.class.php +++ b/webapp/controller/OtherController.class.php @@ -27,7 +27,7 @@ use models\Staking; use models\SeasonRanking; use models\RewardsCec; use models\GlobalData; - + class OtherController extends BaseAuthedController { const MISSION = 1; const PIECE = 2; @@ -181,38 +181,52 @@ class OtherController extends BaseAuthedController { } - - public function getMapModeList() - { - $modeList = array(); - $taskStatus = GlobalData::getServerTaskStatus(); - $taskMeta = mt\ServerTaskTime::getCurrentTime(); - mt\MapMode::traverseMeta(function($modeMeta) use(&$modeList, &$taskMeta, $taskStatus){ - if ($modeMeta['is_open']) { - if ($modeMeta['limit_time']) { - if (empty($taskStatus)) { - return true; - } - if (!$taskMeta) { - return true; - } - if (myself()->_getNowTime() <= strtotime($taskMeta['income_start_time'])) { - return true; - } - } - array_push( - $modeList, - array( - 'id' => $modeMeta['id'] - ) - ); - } - return true; - }); - $this->_rspData(array( - 'mode_list' => $modeList - )); - } - + + public function getMapModeList() + { + $modeList = array(); + $taskStatus = GlobalData::getServerTaskStatus(); + $taskMeta = mt\ServerTaskTime::getCurrentTime(); + $rankSeasonMeta = mt\RankSeason::getCurrentSeason(); + mt\MapMode::traverseMeta(function($modeMeta) use(&$modeList, &$taskMeta, $taskStatus,$rankSeasonMeta){ + if ($modeMeta['is_open']) { +// if ($modeMeta['limit_time']) { +// if (empty($taskStatus)) { +// return true; +// } +// if (!$taskMeta) { +// return true; +// } +// if (myself()->_getNowTime() <= strtotime($taskMeta['income_start_time'])) { +// return true; +// } +// } + switch ($modeMeta['limit_time']){ + case 1 : { + if (!$rankSeasonMeta){ + return true; + } + } + case 2 : { + if (empty($taskStatus) || !$taskMeta || myself()->_getNowTime() <= strtotime($taskMeta['income_start_time'])) { + return true; + } + } + } + + array_push( + $modeList, + array( + 'id' => $modeMeta['id'] + ) + ); + } + return true; + }); + $this->_rspData(array( + 'mode_list' => $modeList + )); + } + }