From ec24d315aee688c178c322832930e3ad628893c2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 2 Aug 2024 17:02:29 +0800 Subject: [PATCH] 1 --- database/bcevent.sql | 32 +++++++++++++++++++++++++ server/web3sign/controllers/recharge.js | 7 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/database/bcevent.sql b/database/bcevent.sql index edccf7a..619fc1f 100644 --- a/database/bcevent.sql +++ b/database/bcevent.sql @@ -563,3 +563,35 @@ CREATE TABLE `t_param` ( KEY `idx_name` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `t_recharge` +-- + +DROP TABLE IF EXISTS `t_recharge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t_recharge` ( + `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `txhash` varchar(255) NOT NULL DEFAULT '' COMMENT 'txhash', + `log_index` bigint NOT NULL DEFAULT '0' COMMENT 'log_index', + `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id', + `contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address', + `src_idx` bigint NOT NULL DEFAULT '0' COMMENT 'src_idx', + `buyer` varchar(60) NOT NULL DEFAULT '' COMMENT 'buyer', + `passport` varchar(60) NOT NULL DEFAULT '' COMMENT 'passport', + `order_id` varchar(80) NOT NULL DEFAULT '' COMMENT 'order_id', + `currency` varchar(60) NOT NULL DEFAULT '' COMMENT 'currency', + `amount` varchar(80) NOT NULL DEFAULT '' COMMENT 'amount', + `diamond` double NOT NULL DEFAULT '0' COMMENT 'diamond', + `status` int(11) NOT NULL DEFAULT '0' COMMENT '0:未发货 1:已发货', + `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `unikey` (`txhash`, `log_index`, `net_id`, `contract_address`), + KEY `idx_passport_status` (`passport`, `status`), + KEY `idx_order_id` (`order_id`), + KEY `idx_status` (`status`), + KEY `idx_txhash` (`txhash`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; +/*!40101 SET character_set_client = @saved_cs_client */; diff --git a/server/web3sign/controllers/recharge.js b/server/web3sign/controllers/recharge.js index e02ee80..499c941 100644 --- a/server/web3sign/controllers/recharge.js +++ b/server/web3sign/controllers/recharge.js @@ -93,6 +93,8 @@ async function recharge(session) { orderId, currencyAddress, amount, + gameMallAddress, + netId, nowTime, nonce ); @@ -102,8 +104,11 @@ async function recharge(session) { orderId, currencyAddress, amount, + gameMallAddress, + netId, nowTime, - nonce); + nonce, + signature); let data = instance.methods.buy( passportAddress, orderId,