This commit is contained in:
aozhiwei 2023-08-15 13:45:15 +08:00
parent 4df42e549e
commit 6b8c8c3159
6 changed files with 273 additions and 0 deletions

View File

@ -0,0 +1,5 @@
begin;
alter table t_bc_order add column `price` varchar(60) COMMENT '价格';
commit;

View File

@ -0,0 +1,59 @@
begin;
CREATE TABLE `t_shop_buy_order` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '订单id',
`address` varchar(60) NOT NULL COMMENT '账户id',
`createtime` int(11) NOT NULL COMMENT '订单开始时间',
`id` int(11) NOT NULL COMMENT '商店货物id',
`item_id` int(11) NOT NULL COMMENT '道具id',
`goods_num` int(11) NOT NULL COMMENT '购买个数',
`status` int(11) NOT NULL COMMENT '订单状态 0-客户端申请了订单 1-订单完成 2-订单失败',
PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=184 DEFAULT CHARSET=utf8;
CREATE TABLE `t_user_honor` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`address` varchar(60) NOT NULL COMMENT '钱包地址',
`honor1` int(11) COMMENT 'nft类型6 1:佩戴',
`honor2` int(11) COMMENT 'honor2',
`honor3` int(11) COMMENT 'honor3',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `address` (`address`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_web2_order` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`status` int(11) NOT NULL COMMENT '订单状态 0-客户端申请了订单 1-订单完成 2-订单失败',
`order_id` varchar(64) DEFAULT NULL COMMENT '订单id',
`createtime` datetime NOT NULL COMMENT '创建时间',
`account_id` varchar(64) NOT NULL COMMENT '申请账号id',
`address` varchar(64) DEFAULT NULL COMMENT '申请时账号绑定的钱包',
`item_id` int(11) NOT NULL COMMENT '物品id',
`item_num` int(11) NOT NULL COMMENT '物品数量',
`id` int(11) NOT NULL COMMENT '商店中的配置id',
`goods_num` int(11) NOT NULL COMMENT '购买商品个数',
`price` varchar(64) DEFAULT NULL COMMENT '价格',
`ext_data` mediumblob COMMENT '扩展自定义数据',
`channel` varchar(64) DEFAULT NULL COMMENT 'google or apple',
`out_order_id` varchar(64) DEFAULT NULL COMMENT 'app store order_id',
PRIMARY KEY (`idx`),
UNIQUE KEY `order_id` (`order_id`),
KEY `out_order_id` (`out_order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8;
CREATE TABLE `t_first_topup` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
`address` varchar(64) NOT NULL COMMENT '账户id',
`createtime` int(11) NOT NULL COMMENT '首充时间',
`status1` int(11) NOT NULL DEFAULT '0' COMMENT '领取状态1 0 不能领取 1 可领取状态 2 已领取',
`status2` int(11) NOT NULL DEFAULT '0' COMMENT '领取状态2',
`status3` int(11) NOT NULL DEFAULT '0' COMMENT '领取状态3',
PRIMARY KEY (`idx`,`account_id`),
UNIQUE KEY `account` (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
insert into version (version) values(2023071001);
commit;

View File

@ -0,0 +1,74 @@
begin;
CREATE TABLE `t_market_store` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`order_id` varchar(64) DEFAULT NULL COMMENT '订单id',
`o_link` varchar(64) DEFAULT NULL COMMENT '关联的链上上架单号',
`status` int(11) NOT NULL COMMENT '订单状态 0:出售中 1:已下架 2:已售出 3:购买中',
`owner_address` varchar(60) NOT NULL COMMENT '当前拥有者',
`token_id` varchar(60) DEFAULT NULL COMMENT 'token_id',
`nft_token` varchar(64) DEFAULT NULL COMMENT 'nftToken',
`token_type` int(11) NOT NULL COMMENT 'nft类型 1:英雄 2:枪支 3:芯片',
`item_id` int(11) DEFAULT NULL COMMENT '特殊字段,用于标记中心化道具,用于交易金币',
`amount` bigint(20) NOT NULL DEFAULT '1' COMMENT '堆叠数量',
`createtime` int(11) NOT NULL COMMENT '创建时间(上架时间)',
`modifytime` int(11) NOT NULL COMMENT '修改时间(更新价格等)',
`buytime` int(11) NOT NULL COMMENT '开始购买的时间',
`s_currency` varchar(64) NOT NULL COMMENT '出售时选择的币种地址',
`s_price` varchar(64) NOT NULL COMMENT '出售价格',
`c_name` varchar(32) NOT NULL COMMENT '缓存-名称',
`c_job` int(11) NOT NULL COMMENT '缓存-职业',
`c_type` int(11) NOT NULL COMMENT '缓存-碎片类型',
`c_lv` int(11) NOT NULL COMMENT '缓存-级别',
`c_quality` int(11) NOT NULL COMMENT '缓存-品阶',
`c_durability` float NOT NULL COMMENT '缓存-能量',
`c_id` int(11) NOT NULL COMMENT '缓存-id',
PRIMARY KEY (`idx`) USING BTREE,
UNIQUE KEY `idx` (`idx`),
UNIQUE KEY `o_link` (`o_link`) USING BTREE,
UNIQUE KEY `order_id` (`order_id`) USING BTREE,
KEY `owner_address` (`owner_address`),
KEY `token_id` (`token_id`),
KEY `createtime` (`createtime`),
KEY `s_currency` (`s_currency`),
KEY `s_price` (`s_price`),
KEY `c_name` (`c_name`),
KEY `c_job` (`c_job`),
KEY `c_lv` (`c_lv`),
KEY `c_quality` (`c_quality`),
KEY `c_durability` (`c_durability`),
KEY `c_id` (`c_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10048 DEFAULT CHARSET=utf8;
CREATE TABLE `t_market_transaction_record` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT,
`createtime` int(11) NOT NULL COMMENT '交易成功时间',
`order_id` varchar(64) NOT NULL DEFAULT '0' COMMENT '订单id',
`o_link` varchar(64) NOT NULL COMMENT '合约订单id',
`seller` varchar(60) NOT NULL COMMENT '卖家',
`buyer` varchar(60) NOT NULL COMMENT '买家',
`token_id` varchar(60) NOT NULL COMMENT 'tokenid',
`item_id` int(11) DEFAULT NULL COMMENT '如果有,说明是中心化道具交易',
`amount` bigint(20) NOT NULL COMMENT '堆叠数量',
`name` varchar(64) NOT NULL COMMENT '商品名称',
`type` int(11) NOT NULL COMMENT '商品类型',
PRIMARY KEY (`idx`),
KEY `createtime` (`createtime`),
KEY `seller` (`seller`),
KEY `buyer` (`buyer`),
KEY `o_link` (`o_link`),
KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10002 DEFAULT CHARSET=utf8;
ALTER TABLE t_web2_order MODIFY COLUMN `item_num` bigint(20) DEFAULT NULL COMMENT '道具数量';
ALTER TABLE t_web2_order MODIFY COLUMN `goods_num` bigint(20) DEFAULT NULL COMMENT '购买商品个数';
ALTER TABLE t_web2_order CHANGE account_Id account_id varchar(64) NOT NULL COMMENT '申请账号id';
ALTER TABLE t_web2_order MODIFY COLUMN `createtime` int(11) NOT NULL COMMENT '创建时间';
ALTER TABLE t_shop_buy_order ADD COLUMN `order_id` varchar(64) DEFAULT NULL COMMENT '订单id';
ALTER TABLE t_shop_buy_order add UNIQUE KEY `order_id` (`order_id`);
insert into version (version) values(2023071301);
commit;

View File

@ -0,0 +1,5 @@
begin;
alter table t_season_ranking add column `ranking_point` bigint NOT NULL DEFAULT '0' COMMENT '排名SV积分';
commit;

View File

@ -0,0 +1,5 @@
UPDATE t_user o JOIN (
SELECT owner_address, item_id, SUM(amount) as t FROM t_market_store WHERE `status`=3 AND item_id=10001 GROUP BY owner_address
) t ON o.address = t.owner_address
SET o.gold = o.gold + t.t;
UPDATE t_market_store SET `status`=1 WHERE `status`=3;

View File

@ -0,0 +1,125 @@
begin;
CREATE TABLE `t_orderid` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
`request` mediumblob COMMENT 'request',
`confirmed` int(11) NOT NULL DEFAULT '0' COMMENT '是否已确认',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
KEY `account_id` (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_inapp_record` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id',
`amount` double NOT NULL DEFAULT '0' COMMENT '充值总额',
`buy_times` int(11) NOT NULL DEFAULT '0' COMMENT '充值次数',
`amount_ok` double NOT NULL DEFAULT '0' COMMENT '充值成功总额',
`buy_ok_times` int(11) NOT NULL DEFAULT '0' COMMENT '充值成功次数',
`daytime` int(11) NOT NULL DEFAULT '0' COMMENT '时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
KEY `account_id` (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_inapp_order` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
`sp_order_id` varchar(64) DEFAULT NULL COMMENT 'app store order_id',
`platform` int(11) NOT NULL DEFAULT '0' COMMENT '0: ios 1: android',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '申请账号id',
`goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '物品id',
`price` double NOT NULL DEFAULT '0' COMMENT '价格',
`status` int(11) NOT NULL DEFAULT '0' COMMENT 'status',
`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 `platform_sp_order_id` (`platform`, `sp_order_id`),
KEY `account_id` (`account_id`),
KEY `sp_order_id` (`sp_order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_outapp_order` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
`sp_order_id` varchar(64) DEFAULT NULL COMMENT 'app store order_id',
`platform` int(11) NOT NULL DEFAULT '0' COMMENT '0: ios 1: android',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '申请账号id',
`address` varchar(60) DEFAULT NULL COMMENT '申请时账号绑定的钱包',
`goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '物品id',
`price` double NOT NULL DEFAULT '0' COMMENT '价格',
`params` mediumblob COMMENT 'params',
`status` int(11) NOT NULL DEFAULT '0' COMMENT 'status',
`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 `platform_sp_order_id` (`platform`, `sp_order_id`),
KEY `account_id` (`account_id`),
KEY `address` (`address`),
KEY `sp_order_id` (`sp_order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_mall` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`order_id` varchar(255) NOT NULL DEFAULT '' COMMENT '订单id',
`goods_uuid` varchar(255) NOT NULL DEFAULT '' COMMENT '商品uuid',
`seller` varchar(60) NOT NULL DEFAULT '' COMMENT 'seller',
`seller_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'seller_address',
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '物品id',
`item_num` bigint NOT NULL DEFAULT '0' COMMENT '物品数量',
`currency` varchar(60) NOT NULL COMMENT 'currency',
`price` varchar(255) NOT NULL DEFAULT '' COMMENT 'price',
`status` int(11) NOT NULL DEFAULT '0' COMMENT 'status',
`last_buy_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次购买时间',
`last_buyer` varchar(60) NOT NULL DEFAULT '' COMMENT '最后一次购买者',
`last_modify_price_time` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次修改价格事件',
`buyer` varchar(60) NOT NULL DEFAULT '' COMMENT '购买成功者',
`buy_ok_time` int(11) NOT NULL DEFAULT '0' COMMENT '购买成功时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
KEY `seller` (`seller`),
KEY `seller_address` (`seller_address`),
KEY `price` (`price`),
UNIQUE KEY `order_id` (`order_id`),
UNIQUE KEY `goods_uuid` (`goods_uuid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_market` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`net_id` bigint NOT NULL DEFAULT '0' COMMENT 'net_id',
`order_id` varchar(255) NOT NULL DEFAULT '' COMMENT '订单id',
`token_id` varchar(60) NOT NULL COMMENT 'token_id',
`seller` varchar(60) NOT NULL COMMENT 'owner',
`buyer` varchar(60) NOT NULL COMMENT 'owner',
`nft_token` varchar(60) NOT NULL COMMENT 'nft_token',
`amount` varchar(255) NOT NULL DEFAULT '' COMMENT 'amount',
`currency` varchar(60) NOT NULL COMMENT 'currency',
`price` varchar(255) NOT NULL DEFAULT '' COMMENT 'price',
`update_price` varchar(255) COMMENT 'update_price',
`update_time` int(11) COMMENT 'update_time',
`c_name` varchar(32) NOT NULL DEFAULT '' COMMENT '缓存-名称',
`c_job` int(11) NOT NULL DEFAULT '0' COMMENT '缓存-职业',
`c_type` int(11) NOT NULL DEFAULT '0' COMMENT '缓存-碎片类型',
`c_lv` int(11) NOT NULL DEFAULT '0' COMMENT '缓存-级别',
`c_quality` int(11) NOT NULL DEFAULT '0' COMMENT '缓存-品阶',
`c_durability` float NOT NULL DEFAULT '0' COMMENT '缓存-能量',
`status` int(11) NOT NULL DEFAULT '0' COMMENT 'status',
`activated` int(11) NOT NULL DEFAULT '0' COMMENT 'activated',
`selltime` int(11) COMMENT 'selltime',
`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`),
KEY `seller_activated` (`seller`, `activated`),
KEY `activated` (`activated`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
insert into version (version) values(2023081501);
commit;