diff --git a/sql/marketdb.sql b/sql/marketdb.sql index fb5f757c..28656433 100644 --- a/sql/marketdb.sql +++ b/sql/marketdb.sql @@ -406,6 +406,25 @@ CREATE TABLE `t_transfer` ( ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `t_user_wallet_offline_temp` +-- + +DROP TABLE IF EXISTS `t_user_wallet_offline_temp`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_user_wallet_offline_temp` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)', + `gold` bigint NOT NULL DEFAULT '0' COMMENT '金币', + `diamond` bigint NOT NULL DEFAULT '0' COMMENT '钻石', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `account_id` (`account_id`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `t_log` -- diff --git a/webapp/controller/BcUserController.class.php b/webapp/controller/BcUserController.class.php index 6c6da23c..dbe49974 100644 --- a/webapp/controller/BcUserController.class.php +++ b/webapp/controller/BcUserController.class.php @@ -22,6 +22,33 @@ use models\BuyRecord; class BcUserController extends BaseController { public function info() + { + $account = strtolower(getReqVal('account', '')); + $token = getReqVal('token', ''); + $gameId = 2006; + $channel = BC_CHANNEL; + $accountId = phpcommon\createAccountId($channel, $gameId, $account); + $conn = myself()->_getMarketMysql($accountId); + $row = SqlHelper::ormSelectOne( + $conn, + 't_user_wallet_offline_temp', + array( + 'account_id' => $accountId, + )); + + $gold = 0; + $diamond = 0; + if ($row) { + $gold = $row['gold']; + $diamond = $row['diamond']; + } + myself()->_rspData(array( + 'gold' => $gold, + 'diamond' => $diamond + )); + } + + private function old_info() { $account = strtolower(getReqVal('account', '')); $token = getReqVal('token', '');