diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql
index 3c031680..c0a65574 100644
--- a/sql/bcnftdb.sql
+++ b/sql/bcnftdb.sql
@@ -319,20 +319,39 @@ 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 '短订单号-客户端显示用',
+ `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 '短订单号-客户端显示用',
`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 */;
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;
+ }
+
}