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 + )); } }