diff --git a/webapp/controller/OtherController.class.php b/webapp/controller/OtherController.class.php index 7377626d..886a7fd3 100644 --- a/webapp/controller/OtherController.class.php +++ b/webapp/controller/OtherController.class.php @@ -186,13 +186,24 @@ class OtherController extends BaseAuthedController { { $modeList = array(); $taskStatus = GlobalData::getServerTaskStatus(); - mt\MapMode::traverseMeta(function($modeMeta) use(&$modeList){ - array_push( - $modeList, - array( - 'id' => $modeMeta['id'] - ) - ); + $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 (myself()->_getNowTime() <= strtotime($taskMeta['obtain_end_time'])) { + return true; + } + } + array_push( + $modeList, + array( + 'id' => $modeMeta['id'] + ) + ); + } return true; }); $this->_rspData(array(