currSeasonMeta = mt\Season::getCurrentSeason(); if (!$this->currSeasonMeta) { $this->_rspErr(10, '服务器内部错误'); die(); } $this->propertyChgService = new services\PropertyChgService(); $this->userInfo = $this->_safeGetOrmUserInfo(); $this->seasonService = new services\SeasonService(); if (!$this->seasonService->checkSeason($this->userInfo)) { $this->userInfo = $this->_safeGetOrmUserInfo(); $this->propertyChgService->addUserChg(); } } public function info() { $this->_rspData(array( array( 'info' => array( 'season_id' => $this->currSeasonMeta['id'], 'card_lv' => $this->seasonDb ? $this->seasonDb['card_lv'] : 1, 'card_exp' => $this->seasonDb ? $this->seasonDb['card_exp'] : 0, 'gift_packages' => $this->getGiftPackages(), 'unlock_rewards' => $this->getUnlockRewards() ) ) )); } public function getReward() { } public function buyLevel() { } public function buyGiftPackage() { $packageId = getReqVal('package_id', 0); $giftPackage = array_find($this->getGiftPackages(), function ($val) use($packageId) { if ($val['package_id'] == $packageId) { return true; } return false; }); if (!$giftPackage) { $this->_rspErr(1, 'pacakge_id参数错误'); return; } if ($giftPackage['state'] == 1) { $this->_rspErr(2, '不能重复购买'); return; } } private function getGiftPackages() { $giftPackages = array( ); return $giftPackages; } private function getUnlockRewards() { $rewards = array( ); return $rewards; } }