diff --git a/webapp/controller/SeasonController.class.php b/webapp/controller/SeasonController.class.php index c66cc68..5e41d88 100644 --- a/webapp/controller/SeasonController.class.php +++ b/webapp/controller/SeasonController.class.php @@ -1,8 +1,11 @@ _rspErr(10, '服务器内部错误'); + return; + } + $propertyChgService = new services\PropertyChgService(); + $userInfo = $this->_safeGetOrmUserInfo(); + $seasonService = new services\SeasonService(); + if (!$seasonService->checkSeason($userInfo)) { + $userInfo = $this->_safeGetOrmUserInfo(); + $propertyChgService->addUserChg(); + } + $rankMeta = mt\Rank::get($userInfo['rank']); + $this->_rspData(array( + array( + 'info' => array( + 'season_id' => $currSeasonMeta['id'], + 'rank' => $userInfo['rank'], + 'max_score' => $rankMeta ? $rankMeta['max_score'] : 0, + 'noshow_score_bar' => $rankMeta ? $rankMeta['noshow_score_bar'] : 1, + 'mission' => $this->getMissionInfo() + ) + ), + 'property_chg' => $propertyChgService->toDto() + )); } public function getMissionReward() { + $currSeasonMeta = mt\Season::getCurrentSeason(); + if (!$currSeasonMeta) { + $this->_rspErr(10, '服务器内部错误'); + return; + } + $mission = $this->getMissionInfo(); + if ($mission['state'] != 1) { + $this->_rspErr(1, '不可领取'); + return; + } + $this->_rspOk(); } - private function precheck($userInfo) + private function getMissionInfo() { + $info = array( + 'state' => 0, + 'current' => 0, + 'target' => 0, + 'target_rank' => 0 + ); + return $info; } }