From ec32461763309ba2574e1752f91723ed1c023108 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 5 Aug 2024 09:59:56 +0800 Subject: [PATCH 1/3] 1 --- sql/bcnftdb.sql | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql index 3c031680..41710d54 100644 --- a/sql/bcnftdb.sql +++ b/sql/bcnftdb.sql @@ -319,20 +319,37 @@ DROP TABLE IF EXISTS `t_recharge_order`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_recharge_order` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', - `order_id` varchar(255) COMMENT '订单号', - `short_order_id` varchar(60) COMMENT '短订单号-客户端显示用', + `account_id` varchar(60) COMMENT 'account_id', + `order_id` varchar(80) COMMENT '订单号', + `short_order_id` bigint NOT NULL DEFAULT '0' COMMENT '短订单号-客户端显示用', `account_address` varchar(60) NOT NULL COMMENT '钱包地址', + `passport_address` varchar(60) NOT NULL COMMENT 'passport地址', `currency_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址', `currency_name` varchar(60) NOT NULL DEFAULT '' COMMENT '货币名称', - `status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 支付中 1: 已发货', `item_id` int(11) NOT NULL COMMENT '道具id', `item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量', - `price` varchar(60) COLLATE utf8_bin NOT NULL COMMENT '价格', + `price` varchar(80) COLLATE utf8_bin NOT NULL COMMENT '价格', + `diamond` double NOT NULL DEFAULT '0' COMMENT 'diamond', + `pay_status` int(11) NOT NULL DEFAULT '0' COMMENT '0:支付中 1:支付成功', + `pay_time` int(11) NOT NULL DEFAULT '0' COMMENT '支付成功时间', + `delivery_status` int(11) NOT NULL DEFAULT '0' COMMENT '0:未发货 1:发货成功', + `delivery_time` int(11) NOT NULL DEFAULT '0' COMMENT '发货成功时间', + `receiver_account_id` varchar(60) COMMENT '收货人account_id', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), - UNIQUE KEY `order_id` (`order_id`), - UNIQUE KEY `short_order_id` (`short_order_id`) + UNIQUE KEY `uk_order_id` (`order_id`), + UNIQUE KEY `uk_short_order_id` (`short_order_id`), + KEY `idx_account_id` (`account_id`), + KEY `idx_account_address` (`account_address`), + KEY `idx_passport_address` (`passport_address`), + KEY `idx_pay_status` (`pay_status`), + KEY `idx_delivery_status` (`delivery_status`), + KEY `idx_passport_address_pay_status_delivery_status` (`passport_address`, `pay_status`, `delivery_status`), + KEY `idx_pay_time` (`pay_time`), + KEY `idx_createtime` (`createtime`), + KEY `idx_delivery_time` (`delivery_time`), + KEY `idx_receiver_account_id` (`receiver_account_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; From d4464a163cf9e5c9d970e0b5ec7916f387fef853 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 5 Aug 2024 10:38:05 +0800 Subject: [PATCH 2/3] 1 --- sql/bcnftdb.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql index 41710d54..c0a65574 100644 --- a/sql/bcnftdb.sql +++ b/sql/bcnftdb.sql @@ -319,6 +319,8 @@ DROP TABLE IF EXISTS `t_recharge_order`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_recharge_order` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', + `net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id', + `txhash` varchar(255) NOT NULL DEFAULT '' COMMENT 'txhash', `account_id` varchar(60) COMMENT 'account_id', `order_id` varchar(80) COMMENT '订单号', `short_order_id` bigint NOT NULL DEFAULT '0' COMMENT '短订单号-客户端显示用', From f572b486f3e5aac6cfad3d5101936f3b95954f4b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 5 Aug 2024 16:24:12 +0800 Subject: [PATCH 3/3] 1 --- .../controller/TempToolsController.class.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/webapp/controller/TempToolsController.class.php b/webapp/controller/TempToolsController.class.php index 9138eba5..f99b3af5 100644 --- a/webapp/controller/TempToolsController.class.php +++ b/webapp/controller/TempToolsController.class.php @@ -873,4 +873,52 @@ EOD; ); } + public function dumpSqlMigrate() + { + $conn = $this->_getMysql(''); + $heroSql = $this->dumpMigrateTable($conn, 't_hero', 'gamedb2006_tmp_1.t_hero_bk', 'WHERE activate=1'); + $mailSql = $this->dumpMigrateTable($conn, 't_mail', 'gamedb2006_tmp_1.t_mail_bk', ''); + $goldBullionSql = $this->dumpMigrateTable($conn, 't_gold_bullion', 'gamedb2006_tmp_1.t_gold_bullion_bk', ''); + echo $heroSql; + echo '
'; + echo '
'; + echo $mailSql; + echo '
'; + echo '
'; + echo $goldBullionSql; + } + + private function dumpMigrateTable($conn, $trgTblName, $srcTblName, $whereSql) + { + $Fields = $conn->execQuery("show columns from ${trgTblName}"); + $inited = false; + $sql = "INSERT INTO ${trgTblName} ("; + foreach ($Fields as $field) { + if ($field['Field'] == 'idx') { + continue; + } + if (!$inited) { + $inited = true; + $sql .= $field['Field']; + } else { + $sql .= ',' . $field['Field']; + } + } + $sql .= ') SELECT '; + $inited = false; + foreach ($Fields as $field) { + if ($field['Field'] == 'idx') { + continue; + } + if (!$inited) { + $inited = true; + $sql .= $field['Field']; + } else { + $sql .= ',' . $field['Field']; + } + } + $sql .= " FROM ${srcTblName} " . $whereSql . ";"; + return $sql; + } + }