From 79e3417fb98ec13e19588f3449e7ea5ef373c0d0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 18 Apr 2024 21:08:35 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index c5146fd9..a43e6b6f 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -531,6 +531,43 @@ class UserController extends BaseAuthedController { )); } + public function getBattleUser() + { + $userDb = SqlHelper::ormSelectOne + (myself()->_getSelfMysql(), + 't_user', + array( + 'account_id' => myself()->_getAccountId() + ) + ); + if (!$userDb) { + $this->_rspErr(1, 'Account does not exist'); + return; + } + $userInfo = User::Info($userDb); + { + $userInfo['total_lucky'] = Hero::getAccountLucky($userInfo['address']); + $userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo); + } + $heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userInfo['hero_uniid']); + if (!$heroDb) { + $this->_rspErr(1, 'Hero does not exist'); + return; + } + $heroInfo = Hero::toDto($heroDb); + $heroInfo['avatar_info'] = Hero::avatarInfo($heroDb); + { + $preset = HeroPreset::getHeroPreset($userDb['hero_id']); + $heroInfo['spec_skill'] = '' . $preset['skill_id']; + } + myself()->_rspData(array( + 'info' => array( + 'user_info' => $userInfo, + 'hero_info' => $heroInfo, + ) + )); + } + public function updateBattleInfo() { $specSkill = getReqVal("skill_id", ""); @@ -547,6 +584,10 @@ class UserController extends BaseAuthedController { return; } $userInfo = User::Info($userDb); + { + $userInfo['total_lucky'] = Hero::getAccountLucky($userInfo['address']); + $userInfo['admission_item_num'] = myself()->_getItemCount(900006, $userInfo); + } $heroDb = Hero::findByAccountId(myself()->_getAccountId(), $heroUniId); if (!$heroDb) { $this->_rspErr(1, 'Hero does not exist');