From 7af50af9f74e7e7a7ae07a9bf60ab85f38c9cfe9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 27 Mar 2022 18:51:21 +0800 Subject: [PATCH] 1 --- webapp/controller/BcUserController.class.php | 32 ++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/webapp/controller/BcUserController.class.php b/webapp/controller/BcUserController.class.php index 05ffd1a8..194a76a4 100644 --- a/webapp/controller/BcUserController.class.php +++ b/webapp/controller/BcUserController.class.php @@ -21,11 +21,6 @@ use models\BuyRecord; class BcUserController extends BaseController { - private function isTestMode() - { - return isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443 && SERVER_ENV == _TEST; - } - public function info() { $account = strtolower(getReqVal('account', '')); @@ -34,7 +29,32 @@ class BcUserController extends BaseController { $channel = BC_CHANNEL; $accountId = phpcommon\createAccountId($channel, $gameId, $account); $conn = myself()->_getMysql($accontId); - + $userRow = SqlHelper::ormSelect( + $conn, + 't_user', + array( + 'account_id' => $accountId, + )); + $walletOfflineRow = SqlHelper::ormSelect( + $conn, + 't_user_wallet_offline', + array( + 'account_id' => $accountId, + )); + $gold = 0; + $diamond = 0; + if ($userRow) { + $gold += $userRow['gold']; + $diamond += $userRow['diamond']; + } + if ($walletOfflineRow) { + $gold += $walletOfflineRow['gold']; + $diamond += $walletOfflineRow['diamond']; + } + myself()->_rspData(array( + 'gold' => $gold, + 'diamond' => $diamond + )); } }