From 11100a4d51e10ef4fafdafe34fa28c762153a515 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 13 Mar 2024 11:06:26 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 502c2df0..2a3f57dd 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -451,6 +451,35 @@ class UserController extends BaseAuthedController { )); } + public function getBattleInfo() + { + $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); + $heroDb = Hero::findByAccountId(myself()->_getAccountId(), $userDb['hero_uniid']); + if (!$heroDb) { + $this->_rspErr(1, 'Hero does not exist'); + return; + } + $heroInfo = Hero::toDto($heroDb); + $heroInfo['avatar_info'] = Hero::avatarInfo($heroDb); + myself()->_rspData(array( + 'info' => array( + 'user_info' => $userInfo, + 'hero_info' => $heroInfo + ) + )); + } + public function query() { $name = getReqVal('name', '');