/*
 Navicat Premium Data Transfer

 Source Server         : 146.56.197.42
 Source Server Type    : MySQL
 Source Server Version : 50731
 Source Host           : 146.56.197.42:3306
 Source Schema         : mall_test

 Target Server Type    : MySQL
 Target Server Version : 50731
 File Encoding         : 65001

 Date: 03/09/2021 14:37:26
*/

SET NAMES utf8mb4;
SET
FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `admin_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '管理员id',
    `merchant_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `role_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '管理员角色id',
    `head_img`    varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
    `account`     varchar(32)  NOT NULL DEFAULT '' COMMENT '管理员账号',
    `password`    varchar(255) NOT NULL DEFAULT '' COMMENT '密码',
    `user`        varchar(32)  NOT NULL DEFAULT '' COMMENT '使用者',
    `link_phone`  varchar(32)  NOT NULL DEFAULT '' COMMENT '联系电话',
    `type`        tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '管理员归属 (1.平台超级管理员 2.商户 3.平台商户 4.平台)',
    `status`      tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态(0.删除 1.可用 2.禁用)',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for admin_auth
-- ----------------------------
DROP TABLE IF EXISTS `admin_auth`;
CREATE TABLE `admin_auth`
(
    `id` bigint(20) NOT NULL COMMENT '自增主键',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for admin_log
-- ----------------------------
DROP TABLE IF EXISTS `admin_log`;
CREATE TABLE `admin_log`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `admin_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '管理员id',
    `type`        tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作模块 \r\n1 -- 首页',
    `operate_log` varchar(255) NOT NULL DEFAULT '' COMMENT '操作日志',
    `note`        varchar(512) NOT NULL DEFAULT '' COMMENT '备注',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1777 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for admin_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_role`;
CREATE TABLE `admin_role`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `role_id`     varchar(32)   NOT NULL DEFAULT '' COMMENT '管理员角色id',
    `role_name`   varchar(32)   NOT NULL DEFAULT '' COMMENT '角色名称',
    `type`        tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类别 (1.平台默认角色 2.商户默认角色 3.平台商户默认角色 4.平台角色 5.商户角色 6.平台商户角色)',
    `status`      tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态(0.删除 1.可用 2.禁用)',
    `auth_json`   varchar(1024) NOT NULL DEFAULT '' COMMENT '权限json',
    `remarks`     varchar(255)  NOT NULL DEFAULT '' COMMENT '备注',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1397862971404853251 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for auth_button
-- ----------------------------
DROP TABLE IF EXISTS `auth_button`;
CREATE TABLE `auth_button`
(
    `id`        bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `btn_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '按钮id',
    `btn_code`  varchar(32) NOT NULL DEFAULT '' COMMENT '按钮英文',
    `btn_name`  varchar(32) NOT NULL DEFAULT '' COMMENT '按钮汉字',
    `btn_title` varchar(32) NOT NULL DEFAULT '' COMMENT '按钮提示',
    `menu_id`   varchar(32) NOT NULL DEFAULT '' COMMENT '归属菜单',
    `status`    tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态（0.正常 1.锁定）',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for auth_menu
-- ----------------------------
DROP TABLE IF EXISTS `auth_menu`;
CREATE TABLE `auth_menu`
(
    `id`                bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `menu_name`         varchar(32)  NOT NULL DEFAULT '' COMMENT '菜单名',
    `parent_menu_index` int(11) NOT NULL DEFAULT 0 COMMENT '父菜单节点索引',
    `menu_index`        int(11) NOT NULL DEFAULT 0 COMMENT '菜单节点索引',
    `menu_url`          varchar(255) NOT NULL DEFAULT '' COMMENT '菜单路径',
    `route`             varchar(32)  NOT NULL DEFAULT '' COMMENT '权限路由',
    `status`            tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态(0.正常 1.禁用)',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 83 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for customer_group
-- ----------------------------
DROP TABLE IF EXISTS `customer_group`;
CREATE TABLE `customer_group`
(
    `id`             bigint(20) NOT NULL COMMENT '主键ID',
    `group_id`       varchar(32)  NOT NULL DEFAULT '' COMMENT '群编号',
    `customer_name`  varchar(255) NOT NULL DEFAULT '' COMMENT '客服名称',
    `user_name`      varchar(255) NOT NULL DEFAULT '' COMMENT '买家名称',
    `customer_image` varchar(255) NOT NULL DEFAULT '' COMMENT '客服头像地址',
    `user_image`     varchar(255) NOT NULL DEFAULT '' COMMENT '买家头像地址',
    `master_id`      varchar(32)  NOT NULL DEFAULT '' COMMENT '群主编号',
    `create_time`    bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`    bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for customer_group_user
-- ----------------------------
DROP TABLE IF EXISTS `customer_group_user`;
CREATE TABLE `customer_group_user`
(
    `id`          bigint(20) NOT NULL COMMENT '主键ID',
    `group_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '群组编号',
    `user_id`     varchar(32) NOT NULL DEFAULT '' COMMENT '用户编号',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for customer_message
-- ----------------------------
DROP TABLE IF EXISTS `customer_message`;
CREATE TABLE `customer_message`
(
    `id`         bigint(20) NOT NULL COMMENT '主键ID',
    `message_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '消息编号',
    `from_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '发送者编号',
    `from_name`  varchar(50)  NOT NULL DEFAULT '' COMMENT '发送者名称',
    `from_image` varchar(500) NOT NULL DEFAULT '' COMMENT '发送者头像地址',
    `to_id`      varchar(50)  NOT NULL DEFAULT '' COMMENT '接收者编号',
    `content`    text         NOT NULL COMMENT '发送内容',
    `msg_type`   bigint(1) NOT NULL DEFAULT 0 COMMENT '消息类型(1-文本,2-图片,3-视频)',
    `send_time`  bigint(20) NOT NULL DEFAULT 0 COMMENT '发送时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for dict_cn_city
-- ----------------------------
DROP TABLE IF EXISTS `dict_cn_city`;
CREATE TABLE `dict_cn_city`
(
    `code`           bigint(20) NOT NULL,
    `province_code`  bigint(20) NULL DEFAULT 0,
    `name`           varchar(255) NULL DEFAULT '',
    `area_code`      int(11) NULL DEFAULT 0,
    `area_name`      varchar(255) NULL DEFAULT '',
    `zip_code`       int(11) NULL DEFAULT 0,
    `pre_pin_yin`    varchar(255) NULL DEFAULT '',
    `pin_yin`        varchar(255) NULL DEFAULT '',
    `simple_pin_yin` varchar(255) NULL DEFAULT '',
    `lon`            varchar(255) NULL DEFAULT '',
    `lat`            varchar(255) NULL DEFAULT '',
    `whole_name`     varchar(255) NULL DEFAULT '',
    PRIMARY KEY (`code`) USING BTREE,
    INDEX            `city_province_code_copy1`(`province_code`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for dict_cn_county
-- ----------------------------
DROP TABLE IF EXISTS `dict_cn_county`;
CREATE TABLE `dict_cn_county`
(
    `code`           bigint(20) NOT NULL,
    `province_code`  bigint(20) NULL DEFAULT 0,
    `city_code`      bigint(20) NULL DEFAULT 0,
    `name`           varchar(255) NULL DEFAULT '',
    `area_code`      int(11) NULL DEFAULT 0,
    `area_name`      varchar(255) NULL DEFAULT '',
    `zip_code`       int(11) NULL DEFAULT 0,
    `pre_pin_yin`    varchar(255) NULL DEFAULT '',
    `pin_yin`        varchar(255) NULL DEFAULT '',
    `simple_pin_yin` varchar(255) NULL DEFAULT '',
    `lon`            varchar(255) NULL DEFAULT '',
    `lat`            varchar(255) NULL DEFAULT '',
    `whole_name`     varchar(255) NULL DEFAULT '',
    PRIMARY KEY (`code`) USING BTREE,
    INDEX            `district_city_code_copy1`(`city_code`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for dict_cn_province
-- ----------------------------
DROP TABLE IF EXISTS `dict_cn_province`;
CREATE TABLE `dict_cn_province`
(
    `code`           bigint(20) NOT NULL,
    `name`           varchar(255) NULL DEFAULT '',
    `area_name`      varchar(255) NULL DEFAULT '',
    `pre_pin_yin`    varchar(255) NULL DEFAULT '',
    `pin_yin`        varchar(255) NULL DEFAULT '',
    `simple_pin_yin` varchar(255) NULL DEFAULT '',
    `lon`            varchar(255) NULL DEFAULT '',
    `lat`            varchar(255) NULL DEFAULT '',
    `whole_name`     varchar(255) NULL DEFAULT '',
    `region`         varchar(255) NULL DEFAULT '' COMMENT '所属区域(华东,华南,华中,华北,西南,西北,东北)',
    PRIMARY KEY (`code`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for dict_cn_street
-- ----------------------------
DROP TABLE IF EXISTS `dict_cn_street`;
CREATE TABLE `dict_cn_street`
(
    `code`           bigint(20) NOT NULL,
    `province_code`  bigint(20) NULL DEFAULT 0,
    `city_code`      bigint(20) NULL DEFAULT 0,
    `county_code`    bigint(20) NULL DEFAULT 0,
    `name`           varchar(255) NULL DEFAULT '',
    `area_code`      int(11) NULL DEFAULT 0,
    `area_name`      varchar(255) NULL DEFAULT '',
    `zip_code`       int(11) NULL DEFAULT 0,
    `pre_pin_yin`    varchar(255) NULL DEFAULT '',
    `pin_yin`        varchar(255) NULL DEFAULT '',
    `simple_pin_yin` varchar(255) NULL DEFAULT '',
    `lon`            varchar(255) NULL DEFAULT '',
    `lat`            varchar(255) NULL DEFAULT '',
    `whole_name`     varchar(255) NULL DEFAULT '',
    PRIMARY KEY (`code`) USING BTREE,
    INDEX            `county_code`(`county_code`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for distribution_address
-- ----------------------------
DROP TABLE IF EXISTS `distribution_address`;
CREATE TABLE `distribution_address`
(
    `id`              bigint(20) NOT NULL COMMENT 'id',
    `address_id`      varchar(32)  NOT NULL DEFAULT '' COMMENT '地址id',
    `address_name`    varchar(255) NOT NULL DEFAULT '' COMMENT '地址名称',
    `contact_name`    varchar(255) NOT NULL DEFAULT '' COMMENT '联系人名称',
    `contact_phone`   varchar(32) NULL DEFAULT '' COMMENT '联系人电话',
    `mailing_address` varchar(255) NULL DEFAULT '' COMMENT '邮寄地址',
    `is_default`      tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否默认(1-是，0-否)',
    `merchant_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '物流中心-地址' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for distribution_company
-- ----------------------------
DROP TABLE IF EXISTS `distribution_company`;
CREATE TABLE `distribution_company`
(
    `id`                  bigint(20) NOT NULL COMMENT 'id',
    `company_id`          varchar(32)  NOT NULL DEFAULT '' COMMENT '快递公司id',
    `company_name`        varchar(255) NOT NULL DEFAULT '' COMMENT '快递名称',
    `company_code`        varchar(32) NULL DEFAULT '' COMMENT '快递代码',
    `cooperation_network` varchar(255) NULL DEFAULT '' COMMENT '合作网点',
    `network_address`     varchar(255) NULL DEFAULT '' COMMENT '网点地址',
    `network_phone`       varchar(32) NULL DEFAULT '' COMMENT '网点电话',
    `merchant_id`         varchar(32)  NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '物流中心-快递公司' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for distribution_express
-- ----------------------------
DROP TABLE IF EXISTS `distribution_express`;
CREATE TABLE `distribution_express`
(
    `id`          bigint(20) NOT NULL COMMENT 'id',
    `express_id`  varchar(32)  NOT NULL DEFAULT '' COMMENT '物流公司id',
    `img_url`     varchar(255) NULL DEFAULT '' COMMENT '物流公司头像',
    `simple_name` varchar(255) NOT NULL DEFAULT '' COMMENT '物流公司简称',
    `phone`       varchar(255) NULL DEFAULT '' COMMENT '物流公司联系方式',
    `exp_name`    varchar(255) NOT NULL DEFAULT '' COMMENT '物流公司名称',
    `url`         varchar(255) NULL DEFAULT '' COMMENT '官网地址',
    `note`        varchar(255) NULL DEFAULT '' COMMENT '备注',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '物流中心-物流公司' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for distribution_template
-- ----------------------------
DROP TABLE IF EXISTS `distribution_template`;
CREATE TABLE `distribution_template`
(
    `id`                  bigint(20) NOT NULL COMMENT 'id',
    `template_id`         varchar(32) NOT NULL DEFAULT '' COMMENT '物流模板id',
    `template_name`       varchar(32) NOT NULL DEFAULT '' COMMENT '模板名称',
    `delivery_address_id` varchar(32) NOT NULL DEFAULT '' COMMENT '发货地址id',
    `billing_type`        tinyint(1) NOT NULL DEFAULT 0 COMMENT '运费设置（1-阶梯计价 2-固定运费）',
    `freight_amount`      decimal(20, 2) NULL DEFAULT 0.00 COMMENT '运费金额',
    `pricing_type`        tinyint(1) NULL DEFAULT 0 COMMENT '计价方式（1-按件数,2-按重量）',
    `base_number`         decimal(20, 2) NULL DEFAULT 0.00 COMMENT '默认运费-基数（件或KG）',
    `base_amount`         decimal(20, 2) NULL DEFAULT 0.00 COMMENT '默认运费-基数对应的费用',
    `add_number`          decimal(20, 2) NULL DEFAULT 0.00 COMMENT '默认运费-续件数（件或KG）',
    `add_cost`            decimal(20, 2) NULL DEFAULT 0.00 COMMENT '默认运费-续件单价',
    `merchant_id`         varchar(32) NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `uk_merchant`(`merchant_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '物流中心-运费模板' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for distribution_template_item
-- ----------------------------
DROP TABLE IF EXISTS `distribution_template_item`;
CREATE TABLE `distribution_template_item`
(
    `id`                   bigint(20) NOT NULL COMMENT 'id',
    `template_id`          varchar(32)  NOT NULL DEFAULT '' COMMENT '运费模板id',
    `template_item_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '指定地区运费规则id',
    `pricing_type`         tinyint(1) NOT NULL DEFAULT 0 COMMENT '计价方式（1-按件数,2-按重量,3-满金额包邮,4-满数量包邮,5-不支持下单）',
    `base_number`          decimal(20, 2) NULL DEFAULT 0.00 COMMENT '基数（件或KG）',
    `base_amount`          decimal(20, 2) NULL DEFAULT 0.00 COMMENT '基数对应的费用',
    `add_number`           decimal(20, 2) NULL DEFAULT 0.00 COMMENT '续件数（件或KG）',
    `add_cost`             decimal(20, 2) NULL DEFAULT 0.00 COMMENT '续件单价',
    `free_shipping_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '满足包邮的金额或件数',
    `remark`               varchar(255) NULL DEFAULT '' COMMENT '备注',
    `delivery_area`        varchar(255) NOT NULL DEFAULT '' COMMENT '运送地区',
    `merchant_id`          varchar(32)  NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '物流中心-运费模板-指定地区运费规则' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for external_token
-- ----------------------------
DROP TABLE IF EXISTS `external_token`;
CREATE TABLE `external_token`
(
    `id`                bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `commodity_pass_id` varchar(32)    NOT NULL DEFAULT '' COMMENT '编号',
    `label_name`        varchar(32)    NOT NULL DEFAULT '' COMMENT '标识名称',
    `available_number`  decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '可用数量',
    `bind_number`       decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '已绑定数量',
    `goods_id`          varchar(32)    NOT NULL DEFAULT '' COMMENT '绑定商品编号',
    `goods_name`        varchar(32)    NOT NULL DEFAULT '' COMMENT '绑定商品名称',
    `merchant_id`       varchar(32)    NOT NULL DEFAULT '' COMMENT '商户id',
    `status`            tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '(0.未绑定 1.已绑定)',
    `type`              tinyint(1) NOT NULL DEFAULT 0 COMMENT '(1.token 2.coin 3.nft)',
    `create_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '外部商品通证' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for external_token_trade
-- ----------------------------
DROP TABLE IF EXISTS `external_token_trade`;
CREATE TABLE `external_token_trade`
(
    `id`                bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `commodity_pass_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '外部商品通证编号',
    `trade_id`          varchar(32)  NOT NULL DEFAULT '' COMMENT '交易编号',
    `opposite_address`  varchar(255) NOT NULL DEFAULT '' COMMENT '对方地址',
    `trade_number`      decimal(11, 0) UNSIGNED NOT NULL DEFAULT 0 COMMENT '交易数量',
    `trade_type`        tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '交易类型(1.库存充值 2.商品销售 3.商品退货)',
    `create_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '外部商品通证' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_auction
-- ----------------------------
DROP TABLE IF EXISTS `goods_auction`;
CREATE TABLE `goods_auction`
(
    `id`             bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `auction_id`     varchar(32)    NOT NULL DEFAULT '' COMMENT '拍卖编号',
    `goods_id`       varchar(32)    NOT NULL DEFAULT '' COMMENT '商品编号',
    `start_price`    decimal(20, 8) UNSIGNED NOT NULL DEFAULT 1.00000000 COMMENT '起拍价',
    `final_price`    decimal(20, 8) NOT NULL DEFAULT 1.00000000 COMMENT '成交价',
    `start_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '起拍时间',
    `end_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '结束时间',
    `final_uid`      varchar(32)    NOT NULL DEFAULT '' COMMENT '中标用户编号',
    `seller_deposit` decimal(20, 8) NOT NULL DEFAULT 1.00000000 COMMENT '卖家保证金',
    `buyer_deposit`  decimal(20, 8) NOT NULL DEFAULT 1.00000000 COMMENT '买家保证金',
    `price_increase` decimal(20, 8) NOT NULL DEFAULT 1.00000000 COMMENT '竞价增幅',
    `status`         tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态  0: 删除  1: 进行中  2:结束  3:流拍   4:无人竞拍',
    `create_time`    bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`    bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品拍卖' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_banner
-- ----------------------------
DROP TABLE IF EXISTS `goods_banner`;
CREATE TABLE `goods_banner`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'banner自增主键',
    `type`        int(11) NOT NULL DEFAULT 1 COMMENT '类型  1 活动页面  2 商品推荐',
    `goods_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '商品编号',
    `url`         varchar(255) NOT NULL DEFAULT '' COMMENT '活动页面地址',
    `cover`       varchar(255) NOT NULL DEFAULT '' COMMENT '封面',
    `indexs`      int(11) NOT NULL DEFAULT 1 COMMENT '排序',
    `title`       varchar(50)  NOT NULL DEFAULT '' COMMENT '标题',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态  1：有效  2：无效',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_category
-- ----------------------------
DROP TABLE IF EXISTS `goods_category`;
CREATE TABLE `goods_category`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `category_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '系列编号',
    `clazz_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '所属上一级系列编号',
    `level`       tinyint(4) NOT NULL DEFAULT 1 COMMENT '层级',
    `name`        varchar(32)  NOT NULL DEFAULT '' COMMENT '系列名称',
    `thumb`       varchar(128) NOT NULL DEFAULT '' COMMENT '缩略图',
    `status`      tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0: 删除   1: 有效',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品类别' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_category_spu
-- ----------------------------
DROP TABLE IF EXISTS `goods_category_spu`;
CREATE TABLE `goods_category_spu`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品编号',
    `category_id` varchar(32) NOT NULL DEFAULT '' COMMENT '类别编号',
    `status`      tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 0: 删除   1: 有效',
    `merchant_id` varchar(32) NOT NULL DEFAULT '' COMMENT '商户编号',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 185 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品类别与商品对应表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_comment
-- ----------------------------
DROP TABLE IF EXISTS `goods_comment`;
CREATE TABLE `goods_comment`
(
    `id`                bigint(20) NOT NULL AUTO_INCREMENT COMMENT '评论id',
    `sku_id`            varchar(32)   NOT NULL DEFAULT '' COMMENT '商品sku编号',
    `comment_id`        varchar(32)   NOT NULL DEFAULT '' COMMENT '评论id',
    `merchant_id`       varchar(32)   NOT NULL DEFAULT '' COMMENT '商户Id',
    `goods_id`          varchar(32)   NOT NULL DEFAULT '' COMMENT '商品编号',
    `oid`               varchar(32)   NOT NULL DEFAULT '' COMMENT '提货订单编号',
    `uid`               varchar(32)   NOT NULL DEFAULT '' COMMENT '评论人id',
    `evaluate`          int(4) NOT NULL DEFAULT 0 COMMENT '商品评价：0：好评，1：中评，2：差评',
    `content`           varchar(200)  NOT NULL DEFAULT '' COMMENT '评价详情',
    `images_json`       json NULL COMMENT '图片列表',
    `video`             varchar(255)  NOT NULL DEFAULT '' COMMENT '视频',
    `express_evaluate`  decimal(4, 2) NOT NULL DEFAULT 0.00 COMMENT '物流评分',
    `anonymous`         int(11) NOT NULL DEFAULT 0 COMMENT '匿名 0否  1是',
    `business_evaluate` decimal(4, 2) NOT NULL DEFAULT 0.00 COMMENT '店铺评价分',
    `like_num`          int(11) NOT NULL DEFAULT 0 COMMENT '点赞数量',
    `tip_off_num`       int(11) NOT NULL DEFAULT 0 COMMENT '举报次数',
    `views`             int(11) NOT NULL DEFAULT 0 COMMENT '浏览次数',
    `reply_content`     varchar(255)  NOT NULL DEFAULT '' COMMENT '回复详情',
    `is_append`         int(4) NOT NULL DEFAULT 0 COMMENT '是否追评过，0：否，1：是',
    `is_valid`          int(4) NOT NULL DEFAULT 1 COMMENT '是否可用（0：不可用，1：可用）',
    `is_reply`          int(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否回复（0：未回复，1：已回复）',
    `create_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX               `G_ID_IS_VALID_P1_VALUE_INDEX`(`sku_id`, `is_valid`) USING BTREE COMMENT '商品id+是否可用+商品属性1索引',
    INDEX               `G_ID_IS_VALID_P2_VALUE_INDEX`(`sku_id`, `is_valid`) USING BTREE COMMENT '商品id+是否可用+商品属性2索引'
) ENGINE = InnoDB AUTO_INCREMENT = 36 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品评论表（用于对商品的评论）' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_comment_append
-- ----------------------------
DROP TABLE IF EXISTS `goods_comment_append`;
CREATE TABLE `goods_comment_append`
(
    `id`            bigint(20) NOT NULL COMMENT '追加评论id',
    `comment_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '评论id',
    `content`       varchar(200) NOT NULL DEFAULT '' COMMENT '评价详情',
    `images_json`   json NULL COMMENT '图片列表',
    `video`         varchar(255) NOT NULL DEFAULT '' COMMENT '视频',
    `tip_off_num`   int(11) NOT NULL DEFAULT 0 COMMENT '举报次数',
    `is_valid`      tinyint(4) NOT NULL DEFAULT 1 COMMENT '是否可用（0：不可用，1：可用）',
    `is_reply`      int(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否回复（0：未回复，1：已回复）',
    `reply_content` varchar(255) NOT NULL DEFAULT '' COMMENT '回复详情',
    `create_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX           `comment_id`(`comment_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_count
-- ----------------------------
DROP TABLE IF EXISTS `goods_count`;
CREATE TABLE `goods_count`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `goods_id`    varchar(32)    NOT NULL DEFAULT '' COMMENT '商品编号',
    `sales`       int(11) NOT NULL DEFAULT 0 COMMENT '商品销量',
    `collect`     int(11) NOT NULL DEFAULT 0 COMMENT '商品收藏数',
    `view`        int(11) NOT NULL DEFAULT 0 COMMENT '商品浏览次数',
    `zan`         int(11) NOT NULL DEFAULT 0 COMMENT '商品点赞次数',
    `praise`      int(11) NOT NULL DEFAULT 0 COMMENT '好评数',
    `comment`     int(11) NOT NULL DEFAULT 0 COMMENT '评论数',
    `popular`     decimal(12, 4) NOT NULL DEFAULT 0.0000 COMMENT '人气值',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `gid`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 57 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品统计信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_custom
-- ----------------------------
DROP TABLE IF EXISTS `goods_custom`;
CREATE TABLE `goods_custom`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '平台推荐自增主键id',
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `type`        int(11) NOT NULL DEFAULT 1 COMMENT '类型  1 后台配置  2 系统推荐',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态  1：有效  2：无效',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '平台推荐' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_flash_sale
-- ----------------------------
DROP TABLE IF EXISTS `goods_flash_sale`;
CREATE TABLE `goods_flash_sale`
(
    `id`              bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `flash_sale_id`   varchar(32)    NOT NULL DEFAULT '' COMMENT '活动编号',
    `goods_id`        varchar(32)    NOT NULL DEFAULT '' COMMENT '商品编号',
    `sale_start_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '秒杀开始时间',
    `sale_end_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '秒杀结束时间',
    `merchant_id`     varchar(32)    NOT NULL DEFAULT '' COMMENT '商户号（为空则为平台）',
    `name`            varchar(256)   NOT NULL DEFAULT '' COMMENT '活动名称',
    `sale`            decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '折扣',
    `create_time`     bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`     bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品秒杀活动表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_function
-- ----------------------------
DROP TABLE IF EXISTS `goods_function`;
CREATE TABLE `goods_function`
(
    `id`          int(255) NOT NULL AUTO_INCREMENT COMMENT '功能区自增主键',
    `name`        varchar(50)  NOT NULL DEFAULT '' COMMENT '名称',
    `icon`        varchar(255) NOT NULL DEFAULT '' COMMENT '图标',
    `url`         varchar(255) NOT NULL DEFAULT '' COMMENT '链接',
    `start_time`  bigint(20) NOT NULL DEFAULT 0 COMMENT '开始时间',
    `end_time`    bigint(20) NOT NULL DEFAULT 0 COMMENT '结束时间',
    `order_index` int(11) NOT NULL DEFAULT 0 COMMENT '顺序',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态  1有效  2 删除',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '首页功能区' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_hot
-- ----------------------------
DROP TABLE IF EXISTS `goods_hot`;
CREATE TABLE `goods_hot`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '热推好货自增主键id',
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `type`        int(11) NOT NULL DEFAULT 1 COMMENT '类型  1 后台配置  2 系统推荐',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态  1：有效  2：无效',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '热推好货' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_integral_exchange
-- ----------------------------
DROP TABLE IF EXISTS `goods_integral_exchange`;
CREATE TABLE `goods_integral_exchange`
(
    `id`          bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '自增主键',
    `goods_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '商品编号',
    `name`        varchar(32)  NOT NULL DEFAULT '' COMMENT '商品名称',
    `description` varchar(512) NOT NULL DEFAULT '' COMMENT '商品描述',
    `thumb`       varchar(512) NOT NULL DEFAULT '' COMMENT '缩略图',
    `stock`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '库存',
    `exchange`    int(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '已兑换',
    `p_num`       int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '积分数量',
    `status`      tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0: 删除  1: 上架  2: 下架 ',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_low_price
-- ----------------------------
DROP TABLE IF EXISTS `goods_low_price`;
CREATE TABLE `goods_low_price`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '低价好货自增主键id',
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `type`        int(11) NOT NULL DEFAULT 1 COMMENT '类型  1 后台配置  2 系统推荐',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态  1：有效  2：无效',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '低价好货' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_points_exchange
-- ----------------------------
DROP TABLE IF EXISTS `goods_points_exchange`;
CREATE TABLE `goods_points_exchange`
(
    `id`          bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '自增主键',
    `pe_id`       varchar(32) NOT NULL DEFAULT '' COMMENT '积分兑换编号',
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品编号',
    `stock`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '库存',
    `p_num`       int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '积分数量',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_pre_sale
-- ----------------------------
DROP TABLE IF EXISTS `goods_pre_sale`;
CREATE TABLE `goods_pre_sale`
(
    `id`              bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `pre_sale_id`     varchar(32)    NOT NULL DEFAULT '' COMMENT '预售编号',
    `goods_id`        varchar(32)    NOT NULL DEFAULT '' COMMENT '商品编号',
    `sale_start_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '预售开始时间',
    `sale_end_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '预售结束时间',
    `ship_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '预计发货时间',
    `draw_start_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预计提货开始时间',
    `draw_end_time`   bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '预计提货结束时间',
    `deposit`         decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '定金',
    `deposit_type`    tinyint(1) NOT NULL DEFAULT 0 COMMENT '1.固定比例 2.固定金额',
    `status`          tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 0: 删除  1:有效',
    `create_time`     bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`     bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品预售' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_sale
-- ----------------------------
DROP TABLE IF EXISTS `goods_sale`;
CREATE TABLE `goods_sale`
(
    `id`               bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `goods_id`         varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '商品编号',
    `amount`           decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品最低价格',
    `price`            decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品最低原价',
    `pay_type`         tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '支付方式：0->现货，1->预售',
    `coin_type`        varchar(100) NULL DEFAULT '0' COMMENT '结算币种，ccny/积分等，如果支持多个，用逗号间隔，例如：ccny,dhy',
    `virtual_type`     tinyint(1) NULL DEFAULT 0 COMMENT '是否是虚拟商品：0->不是，1->是',
    `accept_bty`       tinyint(1) NULL DEFAULT 1 COMMENT '是否接受BTY：0->不接受，1->接受',
    `pre_mode`         tinyint(1) NULL DEFAULT 0 COMMENT '预售模式：0->全款预售，1->定金预售',
    `subsist`          decimal(20, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '定金',
    `start_time`       bigint(12) NULL DEFAULT 0 COMMENT '预售开始时间（unix时间戳，秒）',
    `end_time`         bigint(12) NULL DEFAULT 253402271999 COMMENT '预售结束时间（unix时间戳，秒）',
    `t_start_time`     bigint(12) NULL DEFAULT 0 COMMENT '提货开始时间（unix时间戳，秒）',
    `t_end_time`       bigint(12) NULL DEFAULT 253402271999 COMMENT '提货结束时间（unix时间戳，秒）',
    `active_time`      bigint(12) NULL DEFAULT 0 COMMENT '上线时间',
    `count_type`       tinyint(1) NULL DEFAULT 0 COMMENT '计数方式：0->拍下减库存：存在恶拍风险，1->付款减库存：存在超卖风险',
    `post_type`        tinyint(1) NULL DEFAULT 0 COMMENT '物流方式：0->包邮，1->不包邮',
    `first_num`        int(11) NULL DEFAULT 0 COMMENT '首件个数',
    `first_amount`     decimal(20, 2) UNSIGNED NULL DEFAULT 0.00 COMMENT '首件费用',
    `second_num`       int(11) NULL DEFAULT 0 COMMENT '续件个数',
    `second_amount`    decimal(20, 2) NULL DEFAULT 0.00 COMMENT '续件费用',
    `no_post_province` varchar(512) NULL DEFAULT '' COMMENT '不包邮省份编号',
    `no_post_fee`      decimal(20, 2) NULL DEFAULT 0.00 COMMENT '不包邮省份邮费',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `gid`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品其他信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_sale_hot
-- ----------------------------
DROP TABLE IF EXISTS `goods_sale_hot`;
CREATE TABLE `goods_sale_hot`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT '爆款抢购配置表自增id',
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `type`        int(11) NOT NULL DEFAULT 1 COMMENT '类型  1 后台配置  2 系统推荐',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态  1：有效  2：无效',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '爆款推荐' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_sku
-- ----------------------------
DROP TABLE IF EXISTS `goods_sku`;
CREATE TABLE `goods_sku`
(
    `id`                bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `goods_id`          varchar(32)    NOT NULL DEFAULT '' COMMENT '商品编号',
    `sku_id`            varchar(32)    NOT NULL DEFAULT '' COMMENT '规格编号',
    `original_price`    decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '原价',
    `price`             decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '现价 / 促销价',
    `sales`             bigint(11) NOT NULL DEFAULT 0 COMMENT '销量',
    `stock`             bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '库存',
    `circulation`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '发行量',
    `weight`            decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '重量',
    `coin_name`         varchar(32) NULL DEFAULT '' COMMENT '商品货币名称',
    `commodity_pass_id` varchar(32) NULL DEFAULT '' COMMENT '外部token编号',
    `thumb`             varchar(512)   NOT NULL DEFAULT '' COMMENT '规格缩略图',
    `img_list`          varchar(4096)  NOT NULL DEFAULT '' COMMENT '规格图片列表',
    `status`            tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 0: 删除  1: 有效  2: 发行失败',
    `err_msg`           varchar(128)   NOT NULL DEFAULT '' COMMENT '发行错误信息',
    `create_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 90 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品规格表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_sku_prop
-- ----------------------------
DROP TABLE IF EXISTS `goods_sku_prop`;
CREATE TABLE `goods_sku_prop`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `sku_id`      varchar(32)  NOT NULL DEFAULT '' COMMENT '商品规格编号',
    `prop_key`    varchar(128) NOT NULL DEFAULT '' COMMENT '规格名称',
    `prop_val`    varchar(128) NOT NULL DEFAULT '' COMMENT '规格值',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 232 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品规格属性' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for goods_spu
-- ----------------------------
DROP TABLE IF EXISTS `goods_spu`;
CREATE TABLE `goods_spu`
(
    `id`                  bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `goods_id`            varchar(32)    NOT NULL DEFAULT '' COMMENT '商品编号',
    `merchant_id`         varchar(32)    NOT NULL DEFAULT '' COMMENT '商户编号',
    `category_id`         varchar(512)   NOT NULL DEFAULT '' COMMENT '商品类目',
    `template_id`         varchar(32)    NOT NULL DEFAULT '' COMMENT '物流模板id',
    `type`                tinyint(4) NOT NULL DEFAULT 1 COMMENT '类型  1:普通   2:预售   3:竞拍   4:秒杀  5.打包  6.NFT',
    `name`                varchar(128)   NOT NULL DEFAULT '' COMMENT '商品名称',
    `description`         varchar(512)   NOT NULL DEFAULT '' COMMENT '描述',
    `prop`                varchar(1024) NULL DEFAULT '' COMMENT '商品属性',
    `detail`              text           NOT NULL COMMENT '详情',
    `thumb`               varchar(512)   NOT NULL DEFAULT '' COMMENT '缩略图',
    `video`               varchar(512)   NOT NULL DEFAULT '' COMMENT '视频',
    `max_price`           decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '商品最贵spu价格',
    `default_price`       decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '默认价格（最低的的价格）',
    `video_poster`        varchar(512)   NOT NULL DEFAULT '' COMMENT '视频封面',
    `img_list`            varchar(4096)  NOT NULL DEFAULT '' COMMENT '商品图片列表',
    `status`              tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0: 删除  1: 上架  2: 下架  3: 发行中  4: 失败   5:待审核   6:审核未通过 7.审核通过 8.取消发布',
    `bp_num`              int(11) NOT NULL DEFAULT 0 COMMENT '积分数量',
    `return_type`         tinyint(1) NOT NULL DEFAULT 1 COMMENT '1-7天无理由退换货\r\n2-自定义',
    `return_desc`         varchar(255)   NOT NULL DEFAULT '' COMMENT '退货描述',
    `note`                varchar(512)   NOT NULL DEFAULT '' COMMENT '商品备注',
    `check_fail_reason`   varchar(255)   NOT NULL DEFAULT '' COMMENT '审核失败原因',
    `traceability_number` varchar(64)    NOT NULL DEFAULT '' COMMENT '溯源编号',
    `commodity_pass`      tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品通证(0.否 1.是，自动生成Token 2.是，使用外部既有Token)',
    `delay_delivery`      tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '延迟提货(0--否 1--是)',
    `create_time`         bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`         bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 57 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for log_tx_coin
-- ----------------------------
DROP TABLE IF EXISTS `log_tx_coin`;
CREATE TABLE `log_tx_coin`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `uid`         varchar(32) NULL DEFAULT '' COMMENT '用户编号',
    `channel`     tinyint(1) NULL DEFAULT 0 COMMENT '渠道',
    `type`        tinyint(1) NULL DEFAULT 0 COMMENT '类型，0->入币，1->出币',
    `is_token`    tinyint(1) NULL DEFAULT 0 COMMENT '是否是token，0->否，1->是',
    `block`       tinyint(1) NULL DEFAULT 0 COMMENT '类型：0->主链，1->平行链',
    `coin`        varchar(32) NULL DEFAULT '' COMMENT '资产名称',
    `address`     varchar(64) NULL DEFAULT '' COMMENT '充提币地址',
    `amount`      decimal(20, 6) NULL DEFAULT 0.000000 COMMENT '数量',
    `is_active`   tinyint(1) NULL DEFAULT 1 COMMENT '是否成功，0->否，1->是',
    `create_time` bigint(12) NULL DEFAULT 0 COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX         `uid`(`uid`, `coin`, `type`, `address`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '资产变动日志表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for log_tx_coin_channel
-- ----------------------------
DROP TABLE IF EXISTS `log_tx_coin_channel`;
CREATE TABLE `log_tx_coin_channel`
(
    `id`   int(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `name` varchar(32) NULL DEFAULT '' COMMENT '类型',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '日志渠道表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_coupon
-- ----------------------------
DROP TABLE IF EXISTS `marketing_coupon`;
CREATE TABLE `marketing_coupon`
(
    `id`             bigint(20) UNSIGNED NOT NULL DEFAULT 0,
    `coupon_id`      varchar(32)    NOT NULL DEFAULT '' COMMENT '优惠券编号',
    `type`           tinyint(4) NOT NULL DEFAULT 1 COMMENT '类型  1:满减  2:直减  3: 满折  4:折扣   5:旅游消费',
    `name`           varchar(256)   NOT NULL DEFAULT '' COMMENT '优惠券名称',
    `remark`         varchar(512)   NOT NULL DEFAULT '' COMMENT '描述',
    `scope`          int(11) NOT NULL DEFAULT 1 COMMENT '活动范围 1.全部 2.APP 3.PC 4.微信小程序',
    `condition_val`  decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '优惠券条件值',
    `coupon_val`     decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '优惠值',
    `circulation`    bigint(20) NOT NULL DEFAULT 0 COMMENT '发行量  为0表示发行量没有上限',
    `amt`            bigint(20) NOT NULL DEFAULT 0 COMMENT '剩余数量',
    `start_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '开始时间',
    `end_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '结束时间',
    `status`         tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0->不可用;1->可用;2->未开始;3->已过期',
    `range_type`     tinyint(4) NOT NULL DEFAULT 1 COMMENT '范围类型1: 全部  2: 指定类目  3: 指定商品',
    `exchange_price` decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '优惠券兑换价格（仅旅游消费）',
    `merchant_id`    varchar(32)    NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`    bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`    bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品优惠券' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_coupon_category
-- ----------------------------
DROP TABLE IF EXISTS `marketing_coupon_category`;
CREATE TABLE `marketing_coupon_category`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `category_id` varchar(32) NOT NULL DEFAULT '' COMMENT '商品类目id',
    `coupon_id`   varchar(32) NOT NULL DEFAULT '' COMMENT '优惠券编号',
    `merchant_id` varchar(32) NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 47 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '优惠券与商品类目对应表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_coupon_sku
-- ----------------------------
DROP TABLE IF EXISTS `marketing_coupon_sku`;
CREATE TABLE `marketing_coupon_sku`
(
    `id`          bigint(20) UNSIGNED NOT NULL DEFAULT 0,
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `coupon_id`   varchar(32) NOT NULL DEFAULT '' COMMENT '优惠券编号',
    `sku_id`      varchar(32) NOT NULL DEFAULT '' COMMENT '商品规格编号',
    `status`      tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0:删除  1:有效',
    `merchant_id` varchar(32) NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间'
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '优惠券与商品规格对应表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_member_integral_recurrence
-- ----------------------------
DROP TABLE IF EXISTS `marketing_member_integral_recurrence`;
CREATE TABLE `marketing_member_integral_recurrence`
(
    `id`                bigint(20) NOT NULL AUTO_INCREMENT COMMENT '会员配置表自增id',
    `level`             tinyint(4) NOT NULL DEFAULT 1 COMMENT '等级：\r\n1--普通会员\r\n2--白银会员\r\n3--黄金会员\r\n4--钻石会员\r\n5--黑卡会员',
    `shop_refund`       decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '购物返现',
    `evaluation_refund` decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '评价返现',
    `sign_in_refund`    decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '签到返现',
    `merchant_id`       varchar(32) NOT NULL DEFAULT '' COMMENT '商户号',
    `create_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-积分返现' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_promotion
-- ----------------------------
DROP TABLE IF EXISTS `marketing_promotion`;
CREATE TABLE `marketing_promotion`
(
    `id`           bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `promotion_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '促销编号',
    `type`         tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型  1:会员优惠  2:满减  3:每满x减x  4:直降  5: 折扣  ',
    `name`         varchar(256) NOT NULL DEFAULT '' COMMENT '促销名称',
    `scope`        tinyint(3) NOT NULL DEFAULT 1 COMMENT '活动范围 1.全部 2.APP 3.PC 4.微信小程序',
    `remark`       varchar(512) NOT NULL DEFAULT '' COMMENT '描述',
    `start_time`   bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '促销开始时间',
    `end_time`     bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '促销结束时间',
    `status`       tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态 0->不可用;1->进行中;2->未开始;3->已结束',
    `merchant_id`  varchar(32)  NOT NULL DEFAULT '' COMMENT '商户id',
    `range_type`   tinyint(4) NOT NULL DEFAULT 1 COMMENT '范围类型1: 全部  2: 指定类目  3: 指定商品',
    `create_time`  bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`  bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品促销' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_promotion_category
-- ----------------------------
DROP TABLE IF EXISTS `marketing_promotion_category`;
CREATE TABLE `marketing_promotion_category`
(
    `id`           bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `category_id`  varchar(32) NOT NULL DEFAULT '' COMMENT '商品类目id',
    `promotion_id` varchar(32) NOT NULL DEFAULT '' COMMENT '促销活动编号',
    `merchant_id`  varchar(32) NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`  bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`  bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '促销活动与商品类目对应表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_promotion_rule
-- ----------------------------
DROP TABLE IF EXISTS `marketing_promotion_rule`;
CREATE TABLE `marketing_promotion_rule`
(
    `id`                bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `promotion_rule_id` varchar(32)    NOT NULL DEFAULT '' COMMENT '促销规则编号',
    `promotion_id`      varchar(32)    NOT NULL DEFAULT '' COMMENT '促销编号',
    `condition_val`     decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '促销条件值',
    `promotion_val`     decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '促销优惠值',
    `status`            tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0: 删除   1: 有效',
    `merchant_id`       varchar(32)    NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`       bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品促销规则' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for marketing_promotion_sku
-- ----------------------------
DROP TABLE IF EXISTS `marketing_promotion_sku`;
CREATE TABLE `marketing_promotion_sku`
(
    `id`               bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `promotion_sku_id` varchar(32) NOT NULL DEFAULT '' COMMENT '促销活动-商品规格对应关系编号',
    `goods_id`         varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `promotion_id`     varchar(32) NOT NULL DEFAULT '' COMMENT '促销编号',
    `sku_id`           varchar(32) NOT NULL DEFAULT '' COMMENT '商品规格编号',
    `status`           tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 0: 删除   1: 有效',
    `merchant_id`      varchar(32) NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`      bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`      bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品促销与规格对应表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for merchant
-- ----------------------------
DROP TABLE IF EXISTS `merchant`;
CREATE TABLE `merchant`
(
    `id`                  bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `merchant_id`         varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `prefix`              varchar(32)  NOT NULL DEFAULT '' COMMENT '前缀',
    `register_phone`      varchar(32)  NOT NULL DEFAULT '' COMMENT '注册手机号',
    `register_area`       varchar(10)  NOT NULL DEFAULT '+86' COMMENT '注册区域',
    `apply_phone`         varchar(32)  NOT NULL DEFAULT '' COMMENT '申请人联系方式',
    `apply_name`          varchar(32)  NOT NULL DEFAULT '' COMMENT '申请人姓名',
    `level`               tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '商户等级',
    `id_card`             varchar(32)  NOT NULL DEFAULT '' COMMENT '申请人身份证号',
    `front_card_img`      varchar(255) NOT NULL DEFAULT '' COMMENT '申请人证件照_正面',
    `after_card_img`      varchar(255) NOT NULL DEFAULT '' COMMENT '申请人证件照_反面',
    `post_address`        varchar(32)  NOT NULL DEFAULT '' COMMENT '申请人邮寄地址',
    `type`                tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商户类型(1-个人 2-企业)',
    `enterprise_name`     varchar(32)  NOT NULL DEFAULT '' COMMENT '企业名称',
    `credit_code`         varchar(32)  NOT NULL DEFAULT '' COMMENT '社会统一信用码',
    `business_license`    varchar(255) NOT NULL DEFAULT '' COMMENT '营业执照',
    `token_issue_addr`    varchar(255) NOT NULL DEFAULT '' COMMENT 'TOKEN发行地址',
    `token_recover_addr`  varchar(255) NOT NULL DEFAULT '' COMMENT 'TOKEN回收地址',
    `external_token_addr` varchar(255) NOT NULL DEFAULT '' COMMENT '商户通证地址',
    `qr_url`              varchar(255) NOT NULL DEFAULT '' COMMENT '商户通证地址二维码',
    `issue_addr_key`      varchar(255) NOT NULL DEFAULT '' COMMENT '发行地址私钥',
    `status`              tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态(0-正常 1-锁定 2-待完善 3-审核中 4-审核失败 5-待缴费 6-缴费失败 7.待设置密码)',
    `is_delete`           tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `delay_delivery`      tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '延迟提货(0--否 1--是)',
    `reason`              varchar(512) NULL DEFAULT '' COMMENT '审核成功或失败原因',
    `last_login`          bigint(20) NOT NULL DEFAULT 0 COMMENT '最新登录时间',
    `nft_addr`            varchar(255) NOT NULL DEFAULT '' COMMENT 'nft地址',
    `create_time`         bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`         bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for merchant_assets
-- ----------------------------
DROP TABLE IF EXISTS `merchant_assets`;
CREATE TABLE `merchant_assets`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户资产变更表自增id',
    `merchant_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `account`     varchar(255) NOT NULL DEFAULT '' COMMENT '如果是RMB资产，则账户可以不填写，如果是数字货币，则填写数字货币账户地址',
    `coin`        varchar(255) NOT NULL DEFAULT '' COMMENT '资产类型 如:btc、金币',
    `amount`      decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '可用余额',
    `frozen`      decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '冻结余额',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for merchant_assets_flow
-- ----------------------------
DROP TABLE IF EXISTS `merchant_assets_flow`;
CREATE TABLE `merchant_assets_flow`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户资产变更表自增id',
    `flow_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '流水号',
    `merchant_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '商户id',
    `coin`        varchar(255) NOT NULL DEFAULT '' COMMENT '资产类型（如:btc、金币）',
    `amount`      decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '变更资产金额',
    `type`        tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1、支付宝转账-转入 \n2、支付宝转账-转出\n3、微信转账-转入 \n4、微信转账-转出\n5、数字资产转帐-转入 \n6、数字资产转账-转出\n7、充值\n8、提现\n9、支付\n10、退款\n11、销售\n12、发行\n13、增发\n14、回收\n15、减发\n16、提币 17.扣除',
    `status`      tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '流水状态（1.失败 2.成功）',
    `other_side`  varchar(255) NOT NULL DEFAULT '' COMMENT '资产来源(如果是RMB资产，则对方为用户编号，如果是数字资产，则为对方的数字货币地址；如果是平台，则用“平台”即可)',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 160 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for merchant_config
-- ----------------------------
DROP TABLE IF EXISTS `merchant_config`;
CREATE TABLE `merchant_config`
(
    `id`              bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `level`           tinyint(4) NOT NULL DEFAULT 1 COMMENT '等级：\r\n1--基础商户\r\n2--高级商户\r\n3--钻石商户',
    `membership_fee`  decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '会员费（元）',
    `service_fee`     decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '平台服务费（元/年）',
    `draw_proportion` decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '平台抽成比例（%）',
    `create_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for merchant_integral
-- ----------------------------
DROP TABLE IF EXISTS `merchant_integral`;
CREATE TABLE `merchant_integral`
(
    `id`             bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `merchant_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `label`          varchar(32)  NOT NULL DEFAULT '' COMMENT '标识',
    `name`           varchar(32)  NOT NULL DEFAULT '' COMMENT '名称',
    `logo`           varchar(255) NOT NULL DEFAULT '' COMMENT '标志',
    `issue_num`      decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '发行量',
    `balance_num`    decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '余额',
    `issue_addr`     varchar(255) NOT NULL DEFAULT '' COMMENT 'TOKEN发行地址',
    `description`    varchar(512) NOT NULL DEFAULT '' COMMENT '描述',
    `merchant_ratio` int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT '商户兑换比例基（分子）',
    `base_ratio`     int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT '平台兑换比例基（分母）',
    `type`           tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类别（1.商户积分 2.平台基础积分）',
    `status`         tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态（1.发行中 2.发行失败 3.待审核 4.审核失败 5.可用 6.禁用）',
    `fail_reason`    varchar(512) NOT NULL DEFAULT '' COMMENT '审核失败原因',
    `err_msg`        varchar(128) NOT NULL DEFAULT '' COMMENT '发行错误信息',
    `is_delete`      tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除（0.否 1.是）',
    `create_time`    bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`    bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for merchant_pay_mode
-- ----------------------------
DROP TABLE IF EXISTS `merchant_pay_mode`;
CREATE TABLE `merchant_pay_mode`
(
    `id`                 bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `merchant_id`        varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `type`               tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '收付款方式（1.支付宝 2.微信 3.数字资产）',
    `coin`               varchar(20)  NOT NULL DEFAULT '' COMMENT '币种名称 如:BTC、RMB',
    `account_or_address` varchar(255) NOT NULL DEFAULT '' COMMENT '支付宝微信账号或数字资产地址',
    `status`             tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态（0.删除 1.正常）',
    `create_time`        bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`        bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for notice
-- ----------------------------
DROP TABLE IF EXISTS `notice`;
CREATE TABLE `notice`
(
    `id`          bigint(20) NOT NULL COMMENT 'id',
    `notice_id`   varchar(32)  NOT NULL DEFAULT '' COMMENT '公告id',
    `title`       varchar(255) NOT NULL DEFAULT '' COMMENT '标题',
    `content`     text         NOT NULL COMMENT '内容',
    `start_time`  bigint(20) NOT NULL DEFAULT 0 COMMENT '开始时间',
    `end_time`    bigint(20) NOT NULL DEFAULT 0 COMMENT '结束时间',
    `merchant_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '消息中心-公告' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for opration_banner
-- ----------------------------
DROP TABLE IF EXISTS `opration_banner`;
CREATE TABLE `opration_banner`
(
    `id`                  bigint(20) NOT NULL COMMENT 'id',
    `operation_banner_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '运营中心-banner编号',
    `banner_name`         varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
    `banner_image`        varchar(255) NOT NULL DEFAULT '' COMMENT '海报url',
    `banner_type`         tinyint(1) NOT NULL DEFAULT 0 COMMENT '类型(1->产品；2->活动)',
    `url`                 varchar(255) NULL DEFAULT '' COMMENT '活动链接',
    `number`              varchar(32) NULL DEFAULT '' COMMENT '产品编号',
    `display_order`       bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `status`              tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `merchant_id`         varchar(32)  NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-banner' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for opration_floor
-- ----------------------------
DROP TABLE IF EXISTS `opration_floor`;
CREATE TABLE `opration_floor`
(
    `id`                 bigint(20) NOT NULL COMMENT 'id',
    `operation_floor_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '运营中心-楼层编号',
    `name`               varchar(255) NOT NULL DEFAULT '' COMMENT '楼层名称',
    `display_order`      bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `create_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-首页楼层' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for opration_floor_goods
-- ----------------------------
DROP TABLE IF EXISTS `opration_floor_goods`;
CREATE TABLE `opration_floor_goods`
(
    `id`                 bigint(20) NOT NULL COMMENT 'id',
    `operation_floor_id` varchar(32) NOT NULL DEFAULT '' COMMENT '运营中心-楼层编号',
    `goods_id`           varchar(32) NOT NULL DEFAULT '' COMMENT '商品编号',
    `display_order`      bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `status`             tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `create_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-首页楼层' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for opration_function
-- ----------------------------
DROP TABLE IF EXISTS `opration_function`;
CREATE TABLE `opration_function`
(
    `id`                    bigint(20) NOT NULL COMMENT 'id',
    `operation_function_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '运营中心-banner编号',
    `function_name`         varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
    `function_image`        varchar(255) NOT NULL DEFAULT '' COMMENT '图标url',
    `url`                   varchar(255) NOT NULL DEFAULT '' COMMENT '详情链接',
    `display_order`         bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `status`                tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `merchant_id`           varchar(32)  NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`           bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`           bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-功能区' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for opration_keyword
-- ----------------------------
DROP TABLE IF EXISTS `opration_keyword`;
CREATE TABLE `opration_keyword`
(
    `id`                   bigint(20) NOT NULL COMMENT 'id',
    `operation_keyword_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '运营中心-关键字编号',
    `keyword`              varchar(255) NOT NULL DEFAULT '' COMMENT '关键字',
    `display_order`        bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `status`               tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `create_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-关键字' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_complaint
-- ----------------------------
DROP TABLE IF EXISTS `order_complaint`;
CREATE TABLE `order_complaint`
(
    `id`               bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `complaint_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '投诉单编号',
    `uid`              varchar(32)  NOT NULL DEFAULT '' COMMENT '用户编号',
    `order_id`         varchar(32)  NOT NULL DEFAULT '' COMMENT '关联订单编号',
    `order_type`       tinyint(1) NOT NULL DEFAULT 0 COMMENT '关联订单类型(1->商品订单;2->提货订单)',
    `description`      varchar(255) NOT NULL DEFAULT '' COMMENT '投诉描述',
    `complaint_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '投诉单处理状态(1->处理中;2->已完成)',
    `result`           varchar(255) NULL DEFAULT '' COMMENT '处理结果',
    `remark`           varchar(255) NULL DEFAULT '' COMMENT '备注',
    `handler_id`       varchar(32) NULL DEFAULT '' COMMENT '处理人编号',
    `attachments`      json NULL COMMENT '附件',
    `create_time`      bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`      bigint(12) NOT NULL DEFAULT 0 COMMENT '更改时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `pid`(`complaint_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单中心-订单投诉' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_config
-- ----------------------------
DROP TABLE IF EXISTS `order_config`;
CREATE TABLE `order_config`
(
    `id`                   int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `order_close_limit`    bigint(20) NOT NULL DEFAULT 0 COMMENT '未付款，自动关闭订单时间限制（分）',
    `goods_received_limit` bigint(20) NULL DEFAULT 0 COMMENT '未确认收货，系统自动收货限制（天）',
    `deal_close_limit`     bigint(20) NULL DEFAULT 0 COMMENT '自动结束交易（天）',
    `high_opinion_limit`   bigint(20) NULL DEFAULT 0 COMMENT '未评价，系统全自动好评（天）',
    `create_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '信息创建时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单中心-订单设置' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_delivery
-- ----------------------------
DROP TABLE IF EXISTS `order_delivery`;
CREATE TABLE `order_delivery`
(
    `id`                bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `order_delivery_id` varchar(32)    NOT NULL DEFAULT '0' COMMENT '提货订单编号',
    `uid`               varchar(32)    NOT NULL DEFAULT '' COMMENT '用户编号',
    `merchant_id`       varchar(32)    NOT NULL DEFAULT '' COMMENT '卖家编号',
    `goods_id`          varchar(50)    NOT NULL DEFAULT '0' COMMENT '商品编号',
    `sku_id`            varchar(32)    NOT NULL DEFAULT '' COMMENT '具体商品编号',
    `name`              varchar(32)    NOT NULL DEFAULT '' COMMENT '商品名称',
    `coin`              varchar(32)    NOT NULL DEFAULT '' COMMENT '币种名称',
    `number`            int(11) NOT NULL DEFAULT 0 COMMENT '数量',
    `uname`             varchar(32)    NOT NULL DEFAULT '' COMMENT '收货人名称',
    `phone`             varchar(16)    NOT NULL DEFAULT '' COMMENT '收人手机号',
    `address`           varchar(256)   NOT NULL DEFAULT '' COMMENT '收货地址',
    `post_fee`          decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT '快递费',
    `note`              varchar(255)   NOT NULL DEFAULT '' COMMENT '提货备注',
    `delivery_state`    tinyint(1) NOT NULL DEFAULT 0 COMMENT '提货状态，0->待发货，1->已发货，2->已收货，3->已撤销，4->待退货，5->已退货，6->交易结束 7 商家驳回，8->退货待签收',
    `express_type`      varchar(32)    NOT NULL DEFAULT '' COMMENT '快递公司缩写',
    `express_no`        varchar(64)    NOT NULL DEFAULT '' COMMENT '快递单号',
    `express_detail`    json NULL COMMENT '快递物流详情',
    `delivery_time`     bigint(12) NOT NULL DEFAULT 0 COMMENT '发货时间',
    `finish_time`       bigint(12) NOT NULL DEFAULT 0 COMMENT '完成时间',
    `is_delete`         tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除，0->否，1->是',
    `buyer_state`       tinyint(1) NOT NULL DEFAULT 0 COMMENT '买家评价状态，0->未评价，1->已评价，2->已追评',
    `seller_state`      tinyint(1) NOT NULL DEFAULT 0 COMMENT '卖家评价状态，0->未评价，1->已评价',
    `create_time`       bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`       bigint(12) NOT NULL DEFAULT 0 COMMENT '更改时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `oid`(`order_delivery_id`) USING BTREE,
    INDEX               `uid`(`uid`) USING BTREE,
    INDEX               `sid`(`merchant_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 91 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户提货表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_delivery_log
-- ----------------------------
DROP TABLE IF EXISTS `order_delivery_log`;
CREATE TABLE `order_delivery_log`
(
    `id`                bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `order_delivery_id` varchar(32)  NOT NULL DEFAULT '0' COMMENT '提货订单编号',
    `delivery_state`    tinyint(1) NOT NULL DEFAULT 0 COMMENT '提货状态，0->待发货，1->已发货，2->已收货，3->已撤销，4->待退货，5->已退货',
    `operation`         varchar(255) NOT NULL DEFAULT '' COMMENT '操作信息',
    `uid`               varchar(32)  NOT NULL DEFAULT '' COMMENT '用户编号',
    `remark`            varchar(255) NULL DEFAULT '' COMMENT '备注',
    `create_time`       bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`       bigint(12) NOT NULL DEFAULT 0 COMMENT '更改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 75 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户提货表-提货操作记录' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_delivery_refund
-- ----------------------------
DROP TABLE IF EXISTS `order_delivery_refund`;
CREATE TABLE `order_delivery_refund`
(
    `id`                  bigint(11) NOT NULL COMMENT '主键自增编号',
    `order_delivery_id`   varchar(32)  NOT NULL DEFAULT '0' COMMENT '提货订单编号',
    `uid`                 varchar(32)  NOT NULL DEFAULT '' COMMENT '用户编号',
    `return_type`         int(11) NOT NULL DEFAULT 0 COMMENT '0:不合适/不满意 1质量问题 2商品损坏 3价格变化 4商品与页面描述不符 5其他',
    `return_img`          json         NOT NULL COMMENT '图片',
    `return_reason`       varchar(255) NOT NULL DEFAULT '' COMMENT '退货理由',
    `return_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '退货时间',
    `return_update_time`  bigint(20) NOT NULL DEFAULT 0 COMMENT '退货完成或撤销时间',
    `return_express_no`   varchar(50)  NOT NULL DEFAULT '0' COMMENT '退货快递单号',
    `return_express_name` varchar(50)  NOT NULL DEFAULT '0' COMMENT '快递公司缩写',
    `return_state`        tinyint(1) NOT NULL DEFAULT 0 COMMENT '退货前状态',
    `state`               tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态1：提交申请 2商家审核 3寄回商品 4商家退款 5退款成功 6商家驳回 7用户撤回',
    `err_msg`             varchar(200) NOT NULL DEFAULT '' COMMENT '驳回原因',
    `address_id`          varchar(32) NULL DEFAULT '' COMMENT '退货-商家收货地址id',
    `create_time`         bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`         bigint(12) NOT NULL DEFAULT 0 COMMENT '更改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '提货退货单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_detail
-- ----------------------------
DROP TABLE IF EXISTS `order_detail`;
CREATE TABLE `order_detail`
(
    `id`           bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `oid`          varchar(32)    NOT NULL DEFAULT '' COMMENT '订单编号',
    `goods_id`     varchar(32) NULL DEFAULT '' COMMENT '商品编号',
    `sku_id`       varchar(32)    NOT NULL DEFAULT '' COMMENT '商品sku编号',
    `name`         varchar(32)    NOT NULL DEFAULT '' COMMENT '商品名称',
    `coin`         varchar(32)    NOT NULL DEFAULT '' COMMENT '币种名称',
    `number`       int(11) NOT NULL DEFAULT 0 COMMENT '数量',
    `amount`       decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT '单价',
    `bp_name`      varchar(100)   NOT NULL DEFAULT '' COMMENT '积分名称',
    `bp_number`    int(11) NOT NULL DEFAULT 0 COMMENT '积分数量',
    `note`         varchar(255)   NOT NULL DEFAULT '' COMMENT '提货备注，不是直接提货的订单，备注为空',
    `create_time`  bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`  bigint(12) NOT NULL DEFAULT 0 COMMENT '更改时间',
    `seller_state` int(11) NOT NULL DEFAULT 0 COMMENT '卖家评价状态，0->未评价，1->已评价，',
    `buyer_state`  int(11) NOT NULL DEFAULT 0 COMMENT '买家评价状态，0->未评价，1->已评价 2->已追评',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX          `oid`(`oid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 233 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户购物订单详情表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_goods_coupon
-- ----------------------------
DROP TABLE IF EXISTS `order_goods_coupon`;
CREATE TABLE `order_goods_coupon`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT,
    `uid`         varchar(32)    NOT NULL DEFAULT '' COMMENT '用户uid',
    `oid`         varchar(32)    NOT NULL DEFAULT '' COMMENT '订单id',
    `coupon_id`   varchar(500)   NOT NULL DEFAULT '' COMMENT '优惠券id',
    `goods_id`    varchar(32)    NOT NULL DEFAULT '' COMMENT '商品id',
    `amount`      decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '优惠价格',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_goods_promotion
-- ----------------------------
DROP TABLE IF EXISTS `order_goods_promotion`;
CREATE TABLE `order_goods_promotion`
(
    `id`           int(11) NOT NULL AUTO_INCREMENT,
    `uid`          varchar(32)    NOT NULL DEFAULT '' COMMENT '用户uid',
    `oid`          varchar(32)    NOT NULL DEFAULT '' COMMENT '订单id',
    `promotion_id` varchar(32)    NOT NULL DEFAULT '' COMMENT '促销活动id',
    `goods_id`     varchar(32)    NOT NULL DEFAULT '' COMMENT '商品id',
    `amount`       decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '优惠价格',
    `create_time`  bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`  bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_info
-- ----------------------------
DROP TABLE IF EXISTS `order_info`;
CREATE TABLE `order_info`
(
    `id`                      bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `oid`                     varchar(32)    NOT NULL DEFAULT '' COMMENT '订单编号',
    `uid`                     varchar(32)    NOT NULL DEFAULT '' COMMENT '用户编号',
    `pay_id`                  varchar(32)    NOT NULL DEFAULT '0' COMMENT '支付单号',
    `merchant_id`             varchar(32)    NOT NULL DEFAULT '' COMMENT '卖家编号',
    `post_fee`                decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT '邮费',
    `total`                   decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT '总价',
    `accept_digital`          tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否接受数字货币：1->接受，2->不接受',
    `pay_type`                tinyint(1) NOT NULL DEFAULT 0 COMMENT '支付方式，1->支付宝，2->微信，3->ccny',
    `order_type`              tinyint(1) NOT NULL DEFAULT 0 COMMENT '1.普通 2.预售 3.拍卖',
    `order_state`             tinyint(1) NOT NULL DEFAULT 0 COMMENT '订单状态，1->交易成功，2->交易关闭，3->定金已付，4->待退款，5->已退款，6->支付中，7->待支付 ,8 撤销退款, 9->退款驳回, 10 待付尾款 11->链上退款失败 12->退款中 13->退款失败',
    `delivery`                tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否直接提货，0->否，1->是',
    `uname`                   varchar(32)    NOT NULL DEFAULT '' COMMENT '收货人名称',
    `phone`                   varchar(16)    NOT NULL DEFAULT '' COMMENT '收人手机号',
    `address`                 varchar(255)   NOT NULL DEFAULT '' COMMENT '提货地址',
    `is_delete`               tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除，0->否，1->是',
    `v_note`                  varchar(255)   NOT NULL DEFAULT '' COMMENT '审核备注',
    `consult_discount_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '客户协商优惠金额',
    `consult_discount_type`   tinyint(1) NULL DEFAULT 1 COMMENT '优惠类型(1->客户协商优惠)',
    `discount_amount`         decimal(20, 2) NULL DEFAULT 0.00 COMMENT '优惠金额',
    `amount`                  decimal(20, 2) NULL DEFAULT 0.00 COMMENT '应付金额',
    `create_time`             bigint(12) NOT NULL DEFAULT 0 COMMENT '下单时间',
    `update_time`             bigint(12) UNSIGNED NOT NULL DEFAULT 0 COMMENT '支付或取消时间',
    `comment_total`           int(11) NULL DEFAULT 0 COMMENT '评论sku总数',
    `comment_already`         int(11) NULL DEFAULT 0 COMMENT '已经评论sku数量',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `oid`(`oid`) USING BTREE,
    INDEX                     `uid`(`uid`) USING BTREE,
    INDEX                     `sid`(`merchant_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 210 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户购物订单表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_log
-- ----------------------------
DROP TABLE IF EXISTS `order_log`;
CREATE TABLE `order_log`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `oid`         varchar(32)  NOT NULL DEFAULT '0' COMMENT '商品订单编号',
    `order_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '订单状态，1->交易成功，2->交易关闭，3->定金已付，4->待退款，5->已退款，6->支付中，7->待支付',
    `operation`   varchar(255) NOT NULL DEFAULT '0' COMMENT '操作信息',
    `uid`         varchar(32)  NOT NULL DEFAULT '' COMMENT '用户编号',
    `remark`      varchar(255) NULL DEFAULT '' COMMENT '备注',
    `create_time` bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(12) NOT NULL DEFAULT 0 COMMENT '更改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 49 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户购物订单表-订单操作记录' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_pay
-- ----------------------------
DROP TABLE IF EXISTS `order_pay`;
CREATE TABLE `order_pay` (
                             `id` BIGINT(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
                             `pay_id` VARCHAR(32) NOT NULL DEFAULT '0' COMMENT '支付子编号' COLLATE 'utf8mb4_unicode_ci',
                             `uid` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '用户编号' COLLATE 'utf8mb4_unicode_ci',
                             `state` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '支付状态，1->成功，2->失败，3->支付中,4->待付首款，5->代付尾款\\\\r\\\\n\\\\r\\\\n支付状态，6->待付款，7->首款已付款，8->尾款待付款 ,9->已完成，10->支付失败',
                             `total` DECIMAL(20,2) NOT NULL DEFAULT '0.00' COMMENT '总价',
                             `paid_amount` DECIMAL(20,2) NOT NULL DEFAULT '0.00' COMMENT '已支付金额',
                             `unpaid_amount` DECIMAL(20,2) NOT NULL DEFAULT '0.00' COMMENT '待支付金额',
                             `pay_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '支付方式， 1->支付宝，2->微信 , 3->ccny 4：积分',
                             `oids_json` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '订单号' COLLATE 'utf8mb4_unicode_ci',
                             `error` VARCHAR(128) NOT NULL DEFAULT '' COMMENT '失败原因' COLLATE 'utf8mb4_unicode_ci',
                             `create_time` BIGINT(12) NOT NULL DEFAULT '0' COMMENT '创建时间',
                             `update_time` BIGINT(12) NOT NULL DEFAULT '0' COMMENT '更改时间',
                             `pay_time` BIGINT(12) NOT NULL DEFAULT '0' COMMENT '支付时间',
                             `type` INT(11) NOT NULL DEFAULT '1' COMMENT '1 支付订单   2 支付邮费',
                             `pay_info` VARCHAR(2000) NOT NULL DEFAULT ' ' COMMENT '支付信息' COLLATE 'utf8mb4_unicode_ci',
                             `out_biz_no` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '流水号' COLLATE 'utf8mb4_unicode_ci',
                             PRIMARY KEY (`id`) USING BTREE,
                             UNIQUE INDEX `pid` (`pay_id`) USING BTREE
)
    COMMENT='支付订单结果表'
COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB
ROW_FORMAT=DYNAMIC
AUTO_INCREMENT=206
;

-- ----------------------------
-- Table structure for order_pay_record
-- ----------------------------
DROP TABLE IF EXISTS `order_pay_record`;
CREATE TABLE `order_pay_record`
(
    `id`                 bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `pay_id`             varchar(32)    NOT NULL DEFAULT '0' COMMENT '支付编号',
    `uid`                varchar(32)    NOT NULL DEFAULT '' COMMENT '用户编号',
    `state`              tinyint(1) NOT NULL DEFAULT 0 COMMENT '支付状态，1->成功，2->失败，3->支付中',
    `total`              decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT 'total price',
    `pay_amount`         decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT '支付金额',
    `pay_time`           bigint(12) NOT NULL DEFAULT 0 COMMENT '支付时间',
    `pay_type`           tinyint(1) NOT NULL DEFAULT 0 COMMENT '支付方式，1->支付宝，2->微信，3->ccny',
    `pay_form`           tinyint(1) NOT NULL DEFAULT 0 COMMENT '还款形式， 1->付首款， 2->付尾款\r\n\r\n',
    `oid`                varchar(32)    NOT NULL DEFAULT '' COMMENT '订单号',
    `can_delivery`       tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否可直接提货，1->可以,2->不可以',
    `error`              varchar(128)   NOT NULL DEFAULT '' COMMENT '失败原因',
    `currency`           tinyint(1) NOT NULL DEFAULT 0 COMMENT '支付币种',
    `currency_quotation` decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT ' price',
    `merchant_id`        varchar(32)    NOT NULL DEFAULT '' COMMENT '商户id',
    `create_time`        bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`        bigint(12) NOT NULL DEFAULT 0 COMMENT '更改时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `pid`(`pay_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 65 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '支付订单结果表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_preferent
-- ----------------------------
DROP TABLE IF EXISTS `order_preferent`;
CREATE TABLE `order_preferent`
(
    `id`          bigint(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `pay_id`      varchar(32)    NOT NULL DEFAULT '' COMMENT '支付编号',
    `oid`         varchar(32)    NOT NULL DEFAULT '' COMMENT '订单id',
    `type`        tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '优惠类型 （待定）',
    `aid`         varchar(32)    NOT NULL DEFAULT '' COMMENT '优惠活动id',
    `sku_id`      varchar(32)    NOT NULL DEFAULT '' COMMENT '商品规格id',
    `amount`      decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT '促销金额',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_refund
-- ----------------------------
DROP TABLE IF EXISTS `order_refund`;
CREATE TABLE `order_refund`
(
    `id`                 bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `return_index`       varchar(64)  NOT NULL DEFAULT '' COMMENT '退款订单索引，空为全部',
    `oid`                varchar(64)  NOT NULL DEFAULT '' COMMENT '订单oid',
    `return_reason`      varchar(255) NOT NULL DEFAULT '' COMMENT '退款理由',
    `return_type`        int(11) NOT NULL DEFAULT 0 COMMENT '0:不合适/不满意 1质量问题 2商品损坏 3价格变化 4商品与页面描述不符 5其他',
    `return_time`        bigint(12) NOT NULL DEFAULT 0 COMMENT '退款时间',
    `return_img`         json         NOT NULL COMMENT '图片',
    `return_update_time` bigint(12) NOT NULL DEFAULT 0 COMMENT '退款完成或取消时间',
    `return_state`       int(11) NOT NULL DEFAULT 1 COMMENT '1:待审核  2：审核通过  3审核驳回 4取消退款',
    `create_time`        bigint(12) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `err_msg`            varchar(200) NOT NULL DEFAULT '0' COMMENT '审核失败原因',
    `update_time`        bigint(12) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单退款表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_sku
-- ----------------------------
DROP TABLE IF EXISTS `order_sku`;
CREATE TABLE `order_sku`
(
    `id`       bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `oid`      bigint(32) NULL DEFAULT 0 COMMENT '订单编号',
    `coin`     varchar(32) NULL DEFAULT '' COMMENT '币名称',
    `p1_name`  varchar(32) NULL DEFAULT '' COMMENT '属性1的名',
    `p1_value` varchar(32) NULL DEFAULT '' COMMENT '属性1的值',
    `p2_name`  varchar(32) NULL DEFAULT '' COMMENT '属性2的名',
    `p2_value` varchar(32) NULL DEFAULT '' COMMENT '属性2的值',
    `image`    varchar(256) NULL DEFAULT '' COMMENT '图片',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX      `oid`(`oid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单快照 sku 表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for order_spu
-- ----------------------------
DROP TABLE IF EXISTS `order_spu`;
CREATE TABLE `order_spu`
(
    `id`              bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `uid`             varchar(32) NULL DEFAULT '' COMMENT '用户编号',
    `oid`             varchar(32) NULL DEFAULT '' COMMENT '订单编号',
    `goods_id`        varchar(32) NULL DEFAULT '' COMMENT '商品编号',
    `name`            varchar(30) NULL DEFAULT '' COMMENT '商品名称',
    `description`     varchar(255) NULL DEFAULT '' COMMENT '商品描述',
    `type`            tinyint(1) NULL DEFAULT 0 COMMENT '商品类型，0->全新，1->转卖',
    `properties_json` json NULL COMMENT '商品属性',
    `video`           varchar(256) NULL DEFAULT '' COMMENT '视频地址',
    `video_thumb`     varchar(256) NULL DEFAULT '' COMMENT '视频缩略图地址',
    `default_price`   decimal(20, 8) NULL DEFAULT 0.00000000 COMMENT '商品默认第一个规格的价格',
    `thumb`           varchar(256) NULL DEFAULT '' COMMENT '缩略图',
    `images_json`     json NULL COMMENT '图片列表',
    `detail`          text NULL COMMENT '图文描述',
    `create_time`     bigint(12) NULL DEFAULT 0 COMMENT '创建时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX             `oid`(`oid`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '订单快照 spu 表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for platform_assets_flow
-- ----------------------------
DROP TABLE IF EXISTS `platform_assets_flow`;
CREATE TABLE `platform_assets_flow`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户资产变更表自增id',
    `flow_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '流水号',
    `coin`        varchar(255)  NOT NULL DEFAULT '' COMMENT '资产类型（如:btc、金币）',
    `amount`      decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '变更资产金额',
    `type`        tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1、支付宝转账-转入 \n2、支付宝转账-转出\n3、微信转账-转入 \n4、微信转账-转出\n5、数字资产转帐-转入 \n6、数字资产转账-转出\n7、充值\n8、提现\n9、支付\n10、退款\n11、销售\n12、发行\n13、增发\n14、回收\n15、减发\n16、提币 17.扣除',
    `status`      tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '流水状态（1.失败 2.成功）',
    `other_side`  varchar(255) NOT NULL DEFAULT '' COMMENT '资产来源(如果是RMB资产，则对方为用户编号，如果是数字资产，则为对方的数字货币地址；如果是平台，则用“平台”即可)',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 34 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for platform_integral
-- ----------------------------
DROP TABLE IF EXISTS `platform_integral`;
CREATE TABLE `platform_integral`
(
    `id`           bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `label`        varchar(32)  NOT NULL DEFAULT '' COMMENT '标识',
    `name`         varchar(32)  NOT NULL DEFAULT '' COMMENT '名称',
    `account`      varchar(255) NOT NULL DEFAULT '' COMMENT '积分账户',
    `recover_addr` varchar(255) NOT NULL DEFAULT '' COMMENT '回收地址',
    `addr_key`     varchar(255) NOT NULL DEFAULT '' COMMENT '账户私钥',
    `price`        decimal(10, 2) UNSIGNED NOT NULL DEFAULT 1.00 COMMENT '积分价格',
    `issue_num`    decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '发行量',
    `balance_num`  decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '余额',
    `type`         tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类别（1.平台积分 2.平台基础积分）',
    `status`       tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态（1.可用 2.禁用）',
    `create_time`  bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`  bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for platform_setting
-- ----------------------------
DROP TABLE IF EXISTS `platform_setting`;
CREATE TABLE `platform_setting`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `set_event`   varchar(255) NOT NULL DEFAULT '' COMMENT '设置事件',
    `set_result`  varchar(255) NULL DEFAULT '' COMMENT '设置结果',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '平台事件设置' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for shop
-- ----------------------------
DROP TABLE IF EXISTS `shop`;
CREATE TABLE `shop`
(
    `id`            bigint(20) NOT NULL COMMENT 'id',
    `merchant_id`   varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `shop_id`       varchar(32)  NOT NULL DEFAULT '' COMMENT '店铺编号',
    `shop_name`     varchar(255) NOT NULL DEFAULT '' COMMENT '店铺名称',
    `introduction`  text         NOT NULL COMMENT '店铺介绍',
    `contact`       varchar(32)  NOT NULL DEFAULT '' COMMENT '店铺联系人',
    `contact_phone` varchar(32)  NOT NULL DEFAULT '' COMMENT '联系方式',
    `shop_address`  varchar(255) NOT NULL DEFAULT '' COMMENT '店铺联系地址',
    `shop_image`    varchar(255) NOT NULL DEFAULT '' COMMENT '店铺头像url',
    `status`        bigint(1) NOT NULL DEFAULT 1 COMMENT '店铺状态(1->有效;0->无效)',
    `create_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `uk_merchant`(`merchant_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '店铺中心-店铺' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for shop_navigation
-- ----------------------------
DROP TABLE IF EXISTS `shop_navigation`;
CREATE TABLE `shop_navigation`
(
    `id`              bigint(20) NOT NULL COMMENT 'id',
    `navigation_id`   varchar(32)  NOT NULL DEFAULT '' COMMENT '导航编号',
    `shop_id`         varchar(32)  NOT NULL DEFAULT '' COMMENT '店铺编号',
    `navigation_name` varchar(255) NOT NULL DEFAULT '' COMMENT '导航名称',
    `image`           varchar(255) NOT NULL DEFAULT '' COMMENT '导航图标url',
    `status`          bigint(1) NOT NULL DEFAULT 1 COMMENT '导航状态(0->已删除;1->有效)',
    `display_order`   bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `merchant_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '商户号',
    `create_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '店铺中心-店铺导航管理' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for shop_navigation_goods
-- ----------------------------
DROP TABLE IF EXISTS `shop_navigation_goods`;
CREATE TABLE `shop_navigation_goods`
(
    `id`            bigint(20) NOT NULL COMMENT 'id',
    `navigation_id` varchar(32) NOT NULL DEFAULT '' COMMENT '导航编号',
    `goods_id`      varchar(32) NOT NULL DEFAULT '' COMMENT '商品编号',
    `merchant_id`   varchar(32) NOT NULL DEFAULT '' COMMENT '商户号',
    `create_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '店铺中心-店铺导航管理' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sms_template
-- ----------------------------
DROP TABLE IF EXISTS `sms_template`;
CREATE TABLE `sms_template`
(
    `id`               bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `template_name`    varchar(30)  NOT NULL DEFAULT '' COMMENT '模板名称，长度为1~30个字符。',
    `template_content` varchar(500) NOT NULL DEFAULT '' COMMENT '模板内容，长度为1~500个字符。',
    `remark`           varchar(100) NOT NULL DEFAULT '' COMMENT '短信模板申请说明。请在申请说明中描述您的业务使用场景，长度为1~100个字符。',
    `status`           tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态 0: 删除  1: 审核中  2: 审核失败 3.审核通过',
    `reason`           varchar(255) NOT NULL DEFAULT '' COMMENT '创建或审核失败原因',
    `create_time`      bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`      bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_block_chain_management
-- ----------------------------
DROP TABLE IF EXISTS `sys_block_chain_management`;
CREATE TABLE `sys_block_chain_management`
(
    `id`               int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `block_chain_id`   varchar(32)  NOT NULL DEFAULT '' COMMENT '区块链编号',
    `block_chain_name` varchar(128) NOT NULL DEFAULT '' COMMENT '区块链名称',
    `status`           tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否可用(0--已被删除 1--正常 2->停用)',
    `ip`               varchar(128) NOT NULL DEFAULT '' COMMENT '区块链rpc请求ip',
    `port`             varchar(32)  NOT NULL DEFAULT '' COMMENT '区块链rpc请求端口',
    `title`            varchar(128) NOT NULL DEFAULT '' COMMENT '标题',
    `start_height`     int(11) NULL DEFAULT 0 COMMENT '初始区块高度',
    `remark`           varchar(500) NOT NULL DEFAULT '' COMMENT '备注',
    `create_time`      bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`      bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `uk_bc_id`(`block_chain_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统中心-区块链管理' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_block_chain_pass
-- ----------------------------
DROP TABLE IF EXISTS `sys_block_chain_pass`;
CREATE TABLE `sys_block_chain_pass`
(
    `id`                  int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `block_chain_id`      varchar(32)  NOT NULL DEFAULT '' COMMENT '区块链编号',
    `pass_id`             varchar(32)  NOT NULL DEFAULT '' COMMENT '通证编号',
    `pass_identification` varchar(128) NOT NULL DEFAULT '' COMMENT '标识',
    `name`                varchar(128) NOT NULL DEFAULT '' COMMENT '名称',
    `remark`              varchar(500) NOT NULL DEFAULT '' COMMENT '备注',
    `status`              tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否可用(0--已被删除 1--正常 2->停用)',
    `create_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`         bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE,
    UNIQUE INDEX `uk_bc_pass_id`(`pass_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统中心-区块链管理-通证' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `config_id`   varchar(32)  NOT NULL DEFAULT '' COMMENT '配置编号',
    `dict_key`    varchar(128) NOT NULL DEFAULT '' COMMENT 'key',
    `dict_value`  varchar(512) NOT NULL DEFAULT '' COMMENT '值',
    `type`        tinyint(4) NOT NULL DEFAULT 1 COMMENT '配置所属模块（暂时没意义）',
    `comm`        varchar(255) NOT NULL DEFAULT '' COMMENT '备注说明',
    `status`      tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `valid_state` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否可用(0--否 1--是 )',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统中心-系统配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_member
-- ----------------------------
DROP TABLE IF EXISTS `sys_member`;
CREATE TABLE `sys_member`
(
    `id`              bigint(20) NOT NULL AUTO_INCREMENT COMMENT '会员配置表自增id',
    `level`           tinyint(4) NOT NULL DEFAULT 1 COMMENT '等级：\r\n1--普通会员\r\n2--白银会员\r\n3--黄金会员\r\n4--钻石会员\r\n5--黑卡会员',
    `total_consume`   decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '累计消费额',
    `total_recommend` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '累计推荐人数',
    `fee`             decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '会员费',
    `experience`      bigint(20) NOT NULL DEFAULT 0 COMMENT '升级到对应等级所需经验值',
    `create_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '会员配置表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_navigation
-- ----------------------------
DROP TABLE IF EXISTS `sys_navigation`;
CREATE TABLE `sys_navigation`
(
    `id`              int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `navigation_id`   varchar(32)  NOT NULL DEFAULT '' COMMENT '导航编号',
    `navigation_name` varchar(128) NOT NULL DEFAULT '' COMMENT '导航名称',
    `display_order`   bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `status`          tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `create_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统中心-常见问题-导航' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_question
-- ----------------------------
DROP TABLE IF EXISTS `sys_question`;
CREATE TABLE `sys_question`
(
    `id`            int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `question_id`   varchar(32)  NOT NULL DEFAULT '' COMMENT '问题编号',
    `navigation_id` varchar(128) NOT NULL DEFAULT '' COMMENT '导航编号',
    `question`      varchar(255) NOT NULL DEFAULT '' COMMENT '问题',
    `answer`        varchar(255) NOT NULL DEFAULT '' COMMENT '答案',
    `display_order` bigint(20) NOT NULL DEFAULT 0 COMMENT '显示顺序',
    `status`        tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `create_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统中心-常见问题' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for sys_sensitive_words
-- ----------------------------
DROP TABLE IF EXISTS `sys_sensitive_words`;
CREATE TABLE `sys_sensitive_words`
(
    `id`                 int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `sensitive_words_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '配置编号',
    `sensitive_words`    varchar(128) NOT NULL DEFAULT '' COMMENT '关键词',
    `comm`               varchar(255) NOT NULL DEFAULT '' COMMENT '备注说明',
    `status`             tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否删除(0--否 1--是 )',
    `create_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息修改时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统中心-敏感词' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`
(
    `id`             bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户表自增id',
    `uid`            varchar(32)  NOT NULL DEFAULT '' COMMENT '用户唯一标识',
    `token`          varchar(32)  NOT NULL DEFAULT '' COMMENT 'token',
    `status`         tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 1正常  2冻结',
    `login_password` varchar(255) NOT NULL DEFAULT '' COMMENT '登录密码',
    `pay_password`   varchar(255) NOT NULL DEFAULT '' COMMENT '支付密码',
    `area`           varchar(10)  NOT NULL DEFAULT '+86' COMMENT '区域',
    `phone`          varchar(32)  NOT NULL DEFAULT '' COMMENT '用户手机号码',
    `address`        varchar(64)  NOT NULL DEFAULT '' COMMENT 'address',
    `user_id`        varchar(20)  NOT NULL DEFAULT '' COMMENT '用户对外展示唯一id',
    `head_url`       varchar(255) NOT NULL DEFAULT '' COMMENT '用户头像地址',
    `nick_name`      varchar(20)  NOT NULL DEFAULT '' COMMENT '用户昵称',
    `bi_account`     varchar(255) NOT NULL DEFAULT '' COMMENT '币钱包账号',
    `ali_account`    varchar(255) NOT NULL DEFAULT '' COMMENT '支付宝账号',
    `wx_account`     varchar(255) NOT NULL DEFAULT '' COMMENT '微信账号',
    `invite_code`    varchar(32)  NOT NULL DEFAULT '' COMMENT '邀请码',
    `register_code`  varchar(32)  NOT NULL DEFAULT '' COMMENT '注册码',
    `last_login`     bigint(20) NOT NULL DEFAULT 0 COMMENT '最新登录时间',
    `create_time`    bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`    bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    `sex`            int(11) NOT NULL DEFAULT 1 COMMENT '性别 1男  2女',
    `birthday`       date NULL DEFAULT NULL COMMENT '生日',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 39 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_asset
-- ----------------------------
DROP TABLE IF EXISTS `user_asset`;
CREATE TABLE `user_asset`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户资产表自增id',
    `uid`         varchar(32)    NOT NULL DEFAULT '' COMMENT '用户uid',
    `coin`        varchar(255)    NOT NULL DEFAULT '' COMMENT '资产名称 如:btc、金币',
    `frozen`      decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '冻结资产',
    `amount`      decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '可用资产',
    `type`        tinyint(4) NOT NULL DEFAULT 0 COMMENT '资产类型(0、支付币 1、商品币）',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 89 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户资产信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_asset_record
-- ----------------------------
DROP TABLE IF EXISTS `user_asset_record`;
CREATE TABLE `user_asset_record`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户资产变更表自增id',
    `flow_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '流水号',
    `uid`         varchar(32)  NOT NULL DEFAULT '' COMMENT '用户uid',
    `coin`        varchar(255)  NOT NULL DEFAULT '' COMMENT '变更资产名称（如:btc、金币）',
    `type`        tinyint(4) NOT NULL DEFAULT 0 COMMENT '1、支付宝转账-转入 \n2、支付宝转账-转出\n3、微信转账-转入 \n4、微信转账-转出\n5、数字资产转帐-转入 \n6、数字资产转账-转出\n7、充值\n8、提现\n9、支付\n10、退款\n11、销售\n12、发行\n13、增发\n14、回收\n15、减发\n16、提币 17.扣除 18、提货 19评论奖励 20转赠-转入 21转赠-转出 22邀请注册  23 注册奖励',
    `amount`      decimal(20, 8) UNSIGNED NOT NULL DEFAULT 0.00000000 COMMENT '变更资产金额',
    `status`      tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '流水状态（1.失败 2.成功）',
    `other_side`  varchar(255) NOT NULL DEFAULT '' COMMENT '资产来源(如果是RMB资产，则对方为用户编号，如果是数字资产，则为对方的数字货币地址；如果是平台，则用“平台”即可)',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    `hash`        varchar(255) NOT NULL DEFAULT '' COMMENT '转账hash',
    `note`        varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 83 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户资产变更记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_auth
-- ----------------------------
DROP TABLE IF EXISTS `user_auth`;
CREATE TABLE `user_auth`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户实名表自增id',
    `uid`         varchar(32)  NOT NULL DEFAULT '' COMMENT 'uid',
    `sex`         tinyint(4) NOT NULL DEFAULT 0 COMMENT '性别 0:默认值1:男 2:女',
    `name`        varchar(20)  NOT NULL DEFAULT '' COMMENT '姓名',
    `code`        varchar(18)  NOT NULL DEFAULT '' COMMENT '身份证号',
    `front`       varchar(255) NOT NULL DEFAULT '' COMMENT '正面照片',
    `behind`      varchar(255) NOT NULL DEFAULT '' COMMENT '背面',
    `birthday`    date         NOT NULL COMMENT '生日',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '数据入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户实名信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_collections
-- ----------------------------
DROP TABLE IF EXISTS `user_collections`;
CREATE TABLE `user_collections`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户收藏主键',
    `uid`         varchar(32) NOT NULL DEFAULT '' COMMENT '用户uid',
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '是否有效 1: 有效  2 无效',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 41 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_coupon
-- ----------------------------
DROP TABLE IF EXISTS `user_coupon`;
CREATE TABLE `user_coupon`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `uid`         varchar(32) NOT NULL DEFAULT '' COMMENT '用户编号',
    `coupon_id`   varchar(32) NOT NULL DEFAULT '' COMMENT '优惠券编号',
    `status`      tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态  0:删除  1:有效  2:暂停  3:已使用 4:过期',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户与优惠券对应表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_follow
-- ----------------------------
DROP TABLE IF EXISTS `user_follow`;
CREATE TABLE `user_follow`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户关注主键',
    `uid`         varchar(32) NOT NULL DEFAULT '' COMMENT '用户uid',
    `merchant_id` varchar(32) NOT NULL DEFAULT '' COMMENT '商户id',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态 1关注 2不关注',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_foot
-- ----------------------------
DROP TABLE IF EXISTS `user_foot`;
CREATE TABLE `user_foot`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `uid`         varchar(32) NOT NULL DEFAULT '' COMMENT 'uid',
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品id',
    `is_delete`   tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除 1是 0否',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息录入时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户浏览记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_integral
-- ----------------------------
DROP TABLE IF EXISTS `user_integral`;
CREATE TABLE `user_integral`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户积分表自增id',
    `uid`         varchar(32)    NOT NULL DEFAULT '' COMMENT '用户uid',
    `type`        tinyint(4) NOT NULL DEFAULT 1 COMMENT '积分类型 1:平台积分',
    `frozen`      decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '冻结数量',
    `amount`      decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '可用数量',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_integral_record
-- ----------------------------
DROP TABLE IF EXISTS `user_integral_record`;
CREATE TABLE `user_integral_record`
(
    `id`            bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户积分记录表自增id',
    `uid`           varchar(32)    NOT NULL DEFAULT '' COMMENT '用户uid',
    `type`          tinyint(4) NOT NULL DEFAULT 1 COMMENT '积分变更类型 1:购物返积分2:xxxx',
    `number`        decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '变更数量',
    `change_type`   tinyint(4) NOT NULL DEFAULT 1 COMMENT '类型 1：收入 2：支出',
    `integral_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '积分类型 1：平台积分',
    `create_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户积分变更记录表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_invoice_addr
-- ----------------------------
DROP TABLE IF EXISTS `user_invoice_addr`;
CREATE TABLE `user_invoice_addr`
(
    `id`              int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `uid`             varchar(32) NOT NULL DEFAULT '' COMMENT 'uid',
    `type`            tinyint(4) NOT NULL DEFAULT 1 COMMENT '发票类型 1：普通发票 2：增值税专业发票',
    `rise`            varchar(32) NOT NULL DEFAULT '' COMMENT '发票抬头',
    `tax_no`          varchar(32) NOT NULL DEFAULT '' COMMENT '税号',
    `name`            varchar(20) NOT NULL DEFAULT '' COMMENT '联系人',
    `phone`           varchar(11) NOT NULL DEFAULT '' COMMENT '联系方式',
    `email`           varchar(64) NOT NULL DEFAULT '' COMMENT '邮箱',
    `regist_address`  varchar(32) NOT NULL DEFAULT '' COMMENT '单位注册地址',
    `regist_num`      varchar(32) NOT NULL DEFAULT '' COMMENT '单位注册电话',
    `bank`            varchar(32) NOT NULL DEFAULT '' COMMENT '开户银行',
    `bank_account`    varchar(32) NOT NULL DEFAULT '' COMMENT '开户银行账号',
    `default_invoice` tinyint(4) NOT NULL DEFAULT 2 COMMENT '是否默认 1：是  2 ：否',
    `is_delete`       tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除 1 是 0 否',
    `create_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息录入时间',
    `update_time`     bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户发票抬头地址表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_invoice_info
-- ----------------------------
DROP TABLE IF EXISTS `user_invoice_info`;
CREATE TABLE `user_invoice_info`
(
    `id`            int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `invoice_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '发票id',
    `brand_id`      varchar(32)  NOT NULL DEFAULT '' COMMENT '渠道号：品牌商id',
    `order_no`      varchar(32)  NOT NULL DEFAULT '0' COMMENT '订单便编号',
    `apply_uid`     varchar(32)  NOT NULL DEFAULT '' COMMENT '申请人id',
    `apply_name`    varchar(32)  NOT NULL DEFAULT '' COMMENT '申请人姓名',
    `phone_number`  varchar(32)  NOT NULL DEFAULT '' COMMENT '手机号',
    `address`       varchar(32)  NOT NULL DEFAULT '' COMMENT '邮寄地址',
    `rise`          varchar(32)  NOT NULL DEFAULT '' COMMENT '发票抬头',
    `tax_no`        varchar(32)  NOT NULL DEFAULT '' COMMENT '发票税号',
    `commit_time`   bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提交时间',
    `content`       varchar(125) NOT NULL DEFAULT '' COMMENT '发票内容',
    `express_no`    varchar(32)  NOT NULL DEFAULT '' COMMENT '快递单号',
    `invoice_num`   varchar(32)  NOT NULL DEFAULT '' COMMENT '发票号码',
    `serial_num`    varchar(32)  NOT NULL DEFAULT '' COMMENT '发票请求流水号',
    `invoice_code`  varchar(32)  NOT NULL DEFAULT '' COMMENT '发票代码',
    `status`        tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态(1.待开票 2.已开票 3.开票失败 4.开票中5.作废6.作废失败7.已取消)',
    `error`         varchar(125) NOT NULL DEFAULT '' COMMENT '开票失败原因',
    `pdf_url`       varchar(255) NOT NULL DEFAULT '' COMMENT 'pdf地址',
    `image_url`     varchar(255) NOT NULL DEFAULT '' COMMENT '图片预览',
    `red_image_url` varchar(255) NOT NULL DEFAULT '' COMMENT '红票图片地址',
    `create_time`   bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`   bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_mail_address
-- ----------------------------
DROP TABLE IF EXISTS `user_mail_address`;
CREATE TABLE `user_mail_address`
(
    `id`            int(11) NOT NULL AUTO_INCREMENT,
    `uid`           varchar(32)  NOT NULL DEFAULT '' COMMENT '用户 uid',
    `name`          varchar(20)  NOT NULL DEFAULT '' COMMENT '收货人',
    `status`        int(11) NOT NULL DEFAULT 1 COMMENT '状态 1：启用  2： 停用',
    `phone`         varchar(11)  NOT NULL DEFAULT '' COMMENT '手机号',
    `city_code`     bigint(20) NOT NULL DEFAULT 0 COMMENT '城市code',
    `street_code`   bigint(20) NOT NULL DEFAULT 0 COMMENT '街道code',
    `county_code`   bigint(20) NOT NULL DEFAULT 0 COMMENT '区code',
    `province_code` bigint(20) NOT NULL DEFAULT 0 COMMENT '省份code',
    `detail_addr`   varchar(100) NOT NULL DEFAULT '' COMMENT '详细地址',
    `default_addr`  int(11) NOT NULL DEFAULT 1 COMMENT '是否默认  1：是  2 否',
    `create_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`   bigint(20) NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 57 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户收货地址表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_member
-- ----------------------------
DROP TABLE IF EXISTS `user_member`;
CREATE TABLE `user_member`
(
    `id`                bigint(20) NOT NULL AUTO_INCREMENT COMMENT '会员表自增id',
    `uid`               varchar(32) NOT NULL DEFAULT '' COMMENT '用户uid',
    `member_level`      tinyint(4) NOT NULL DEFAULT 1 COMMENT '会员等级',
    `member_experience` bigint(20) NOT NULL DEFAULT 0 COMMENT '会员经验值',
    `create_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户会员信息表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_notice
-- ----------------------------
DROP TABLE IF EXISTS `user_notice`;
CREATE TABLE `user_notice`
(
    `id`          int(11) NOT NULL,
    `uid`         varchar(255) NOT NULL DEFAULT '' COMMENT '用户uid',
    `notice_id`   varchar(255) NOT NULL DEFAULT '' COMMENT '公告id',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_shopping_cart
-- ----------------------------
DROP TABLE IF EXISTS `user_shopping_cart`;
CREATE TABLE `user_shopping_cart`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `uid`         varchar(32) NULL DEFAULT '' COMMENT '用户编号',
    `sku_id`      varchar(32) NOT NULL DEFAULT '' COMMENT '具体商品编号',
    `number`      int(11) NULL DEFAULT 0 COMMENT '数量',
    `is_active`   tinyint(1) NULL DEFAULT 1 COMMENT '是否有效，0->无效，1->有效',
    `create_time` bigint(12) NULL DEFAULT 0 COMMENT '添加时间',
    `update_time` bigint(12) NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX         `uid`(`uid`, `is_active`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 128 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户购物车表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for user_withdraw
-- ----------------------------
DROP TABLE IF EXISTS `user_withdraw`;
CREATE TABLE `user_withdraw`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
    `uid`         varchar(32)    NOT NULL DEFAULT '' COMMENT 'uid',
    `type`        int(11) NOT NULL DEFAULT 3 COMMENT '类型  1：支付宝  2 微信',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态 1提现中  2提现成功 3审核中 4审核失败',
    `amount`      decimal(20, 2) NOT NULL DEFAULT 0.00 COMMENT '提现金额',
    `number`      varchar(255)   NOT NULL DEFAULT '' COMMENT '账号',
    `reason`      varchar(255)   NOT NULL DEFAULT '' COMMENT '审核失败原因',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户提现申请表' ROW_FORMAT = DYNAMIC;

-- ----------------------------
-- Table structure for block_chain_height
-- ----------------------------
DROP TABLE IF EXISTS `block_chain_height`;
CREATE TABLE `block_chain_height`
(
    `id`          bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `type`        tinyint(1) NOT NULL DEFAULT 0 COMMENT '（链类别 0.主链 1.平行链）',
    `height`      bigint(20) NOT NULL DEFAULT 0 COMMENT '当前解析高度',
    `create_time` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='当前解析链的高度';

-- ----------------------------
-- Table structure for goods_nft
-- ----------------------------
DROP TABLE IF EXISTS `goods_nft`;
CREATE TABLE `goods_nft`
(
    `id`          bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `goods_id`    varchar(32) COLLATE utf8mb4_unicode_ci  NOT NULL DEFAULT '' COMMENT '商品编号',
    `price`       decimal(20, 8)                          NOT NULL DEFAULT 0.00000000 COMMENT '价格',
    `tz_type`     tinyint(1) NOT NULL DEFAULT 1 COMMENT '(1.内部发行 2.外部绑定)',
    `type`        tinyint(1) NOT NULL DEFAULT 1 COMMENT 'NFT类型（1.单个，不可考贝 2.可拷贝）',
    `number`      bigint(11) unsigned NOT NULL DEFAULT 1 COMMENT '发行数量：只有商户选择“可拷贝”时，才会出现==>即库存',
    `sales`       bigint(11) NOT NULL DEFAULT 0 COMMENT '销量',
    `stock`       bigint(11) NOT NULL DEFAULT 0 COMMENT '库存',
    `token_id`    varchar(32) COLLATE utf8mb4_unicode_ci  NOT NULL DEFAULT '' COMMENT 'nft  发行id /绑定的外部通证id',
    `hash`        varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '交易hash',
    `create_time` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Table structure for goods_package
-- ----------------------------
DROP TABLE IF EXISTS `goods_package`;
CREATE TABLE `goods_package`
(
    `id`          bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `goods_id`    varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品编号',
    `price`       decimal(20, 8)                         NOT NULL DEFAULT 0.00000000 COMMENT '打包价格',
    `resource`    json                                   NOT NULL COMMENT '打包资源---[{"skuId":xxx,"number":50},{"skuId":yyy,"number":30}]',
    `sales`       bigint(11) NOT NULL DEFAULT 0 COMMENT '销量',
    `stock`       bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '库存',
    `create_time` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Triggers structure for table goods_count
-- ----------------------------
DROP TRIGGER IF EXISTS `good_popular`;
delimiter;;
CREATE TRIGGER `good_popular`
    BEFORE UPDATE
    ON `goods_count`
    FOR EACH ROW
begin
    set new.`popular` = (new.sales * 65 + new.collect * 10 + new.view * 2 + new.zan * 3 + new.praise * 10 + new.comment * 10) / 100;
end
;;
delimiter;

-- ----------------------------
-- Table structure for tran
-- ----------------------------
DROP TABLE IF EXISTS `tran`;
CREATE TABLE `tran`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT '转让仓库主键',
    `uid`         varchar(32)    NOT NULL DEFAULT '' COMMENT '用户uid',
    `tran_id`     varchar(32)    NOT NULL DEFAULT '' COMMENT '转让单号',
    `coin`        varchar(20)    NOT NULL DEFAULT '' COMMENT '资产名称 如:btc、金币',
    `goods_id`    varchar(32)    NOT NULL DEFAULT '' COMMENT '商品id',
    `sku_id`      varchar(32)    NOT NULL DEFAULT '' COMMENT '商品skuId',
    `number`      int(11) NOT NULL DEFAULT 0 COMMENT '商品数量',
    `type`        tinyint(4) NOT NULL DEFAULT 1 COMMENT '类型  1 单价 2 打包',
    `price`       decimal(10, 2) NOT NULL DEFAULT 0.00000000 COMMENT '价格',
    `status`      int(11) NOT NULL DEFAULT 1 COMMENT '状态 1：正常 2：撤回 3：完成',
    `stock`       int(11) NOT NULL DEFAULT 0 COMMENT '库存',
    `note`        varchar(255)   NOT NULL DEFAULT '' COMMENT '备注',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for tran_order
-- ----------------------------
DROP TABLE IF EXISTS `tran_order`;
CREATE TABLE `tran_order`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT '转让订单表主键',
    `uid`         varchar(32)  NOT NULL DEFAULT '' COMMENT '用户uid',
    `seller`      varchar(32)  NOT NULL DEFAULT '' COMMENT '卖家',
    `tran_id`     varchar(32)  NOT NULL DEFAULT '' COMMENT '对应转让id',
    `oid`         varchar(32)  NOT NULL DEFAULT '' COMMENT '订单id',
    `sku_id`      varchar(32)  NOT NULL DEFAULT '' COMMENT '商品sku_id',
    `goods_id`    varchar(32)  NOT NULL DEFAULT '' COMMENT '商品id',
    `number`      int(11) NOT NULL DEFAULT 0 COMMENT '数量',
    `coin`        varchar(20)  NOT NULL DEFAULT '0' COMMENT '商品币名称',
    `price`       decimal(10, 2)        DEFAULT 0.00000000 NOT NULL COMMENT '单价',
    `uname`       varchar(20)  NOT NULL DEFAULT '' COMMENT '收货人',
    `uphone`      varchar(11)  NOT NULL DEFAULT '' COMMENT '收货人手机号',
    `uaddress`    varchar(255) NOT NULL DEFAULT '' COMMENT '收货人地址',
    `post_fee`    decimal(10, 2)        DEFAULT 0.00000000 NOT NULL COMMENT '快递费',
    `delivery`    tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 不提  1 提货',
    `status`      int(11) NOT NULL DEFAULT 0 COMMENT '状态 0：待支付  1：已支付  2：超时关闭  3 ：取消支付',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 50 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for tran_pay
-- ----------------------------
DROP TABLE IF EXISTS `tran_pay`;
CREATE TABLE `tran_pay`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT '支付记录表主键',
    `pay_id`      varchar(32) NOT NULL DEFAULT '' COMMENT '支付id',
    `oid`         varchar(32) NOT NULL DEFAULT '' COMMENT '订单id',
    `amount`      decimal(10, 2)       DEFAULT 0.00000000 NOT NULL COMMENT '支付额',
    `status`      tinyint(4) NOT NULL DEFAULT 0 COMMENT '0:待支付 1 已支付 2取消支付 3关闭支付',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for user_asset_transfer_log
-- ----------------------------
DROP TABLE IF EXISTS `user_asset_transfer_log`;
CREATE TABLE `user_asset_transfer_log`
(
    `id`          bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户资产表自增id',
    `transfer_id` varchar(32) NOT NULL DEFAULT '' COMMENT '转让编号',
    `old_price`   decimal(20, 8) NULL COMMENT '旧的转让价格',
    `new_price`   decimal(20, 8) NULL COMMENT '新的转让价格',
    `type`        tinyint(4) NOT NULL DEFAULT 0 COMMENT '操作（1->撤销，2->修改价格）',
    `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户资产-转让-操作日志' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for user_asset_transfer_record
-- ----------------------------
DROP TABLE IF EXISTS `user_asset_transfer_record`;
CREATE TABLE `user_asset_transfer_record`
(
    `id`                 bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户资产表自增id',
    `transfer_record_id` varchar(32)  NOT NULL DEFAULT '' COMMENT '转赠记录编号',
    `to_address`         varchar(255) NOT NULL DEFAULT '' COMMENT '转赠地址',
    `to_uid`             varchar(32)  NOT NULL DEFAULT '' COMMENT '接收用户uid',
    `num`                int(20) NOT NULL DEFAULT 0 COMMENT '转赠数量',
    `remark`             varchar(500) NOT NULL DEFAULT '' COMMENT '备注',
    `status`             tinyint(4) NOT NULL DEFAULT 0 COMMENT '状态 1->成功，2->失败，3->转账中',
    `uid`                varchar(32)  NOT NULL DEFAULT '' COMMENT '用户uid',
    `goods_id`           varchar(32)  NOT NULL DEFAULT '' COMMENT '商品编号',
    `sku_id`             varchar(32)  NOT NULL DEFAULT '' COMMENT '规格编号',
    `coin`               varchar(255)  NOT NULL DEFAULT '' COMMENT '资产名称 如:btc、金币',
    `create_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`        bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户资产-转赠' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for opration_integral_return_category
-- ----------------------------
DROP TABLE IF EXISTS `opration_integral_return_category`;
CREATE TABLE `opration_integral_return_category`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `category_id` varchar(32) NOT NULL DEFAULT '' COMMENT '商品类目id',
    `return_id`   varchar(32) NOT NULL DEFAULT '' COMMENT '商户积分返现编号',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '促销活动与商品类目对应表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for opration_integral_return_merchant
-- ----------------------------
DROP TABLE IF EXISTS `opration_integral_return_merchant`;
CREATE TABLE `opration_integral_return_merchant`
(
    `id`                   bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键自增编号',
    `return_id`            varchar(32)    NOT NULL DEFAULT '' COMMENT '编号',
    `merchant_id`          varchar(32)    NOT NULL DEFAULT '' COMMENT '商户id',
    `name`                 varchar(255)   NOT NULL DEFAULT '' COMMENT '活动名称',
    `num`                  decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '返现数量',
    `return_condition`     tinyint(1) NOT NULL DEFAULT 0 COMMENT '返现条件（1.每xx个商品 2.满xx元可用）',
    `condition_val`        decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '具体条件',
    `effective_start_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '有效开始时间',
    `effective_end_time`   bigint(20) NOT NULL DEFAULT 0 COMMENT '有效结束时间',
    `remarks`              varchar(255)   NOT NULL DEFAULT '' COMMENT '备注',
    `goods_range`          tinyint(1) NOT NULL DEFAULT 0 COMMENT '商品范围（1.全部商品 2.指定类目 3.指定商品）',
    `status`               tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态（0.删除 1.未开始 2.可用 3.不可用 4.已过期）',
    `create_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time`          bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '积分返现——商户' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for opration_integral_return_platform
-- ----------------------------
DROP TABLE IF EXISTS `opration_integral_return_platform`;
CREATE TABLE `opration_integral_return_platform`
(
    `id`                bigint(20) NOT NULL AUTO_INCREMENT COMMENT '会员表自增id',
    `sort`              tinyint(1) NOT NULL DEFAULT 0 COMMENT '序号',
    `member_level`      tinyint(1) NOT NULL DEFAULT 1 COMMENT '会员等级',
    `shopping_return`   decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '购物返现（平台积分）',
    `evaluation_return` decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '评价返现（砖石）',
    `sign_return`       decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '签到返现（砖石）',
    `create_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`       bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-积分返现-平台' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for opration_integral_return_spu
-- ----------------------------
DROP TABLE IF EXISTS `opration_integral_return_spu`;
CREATE TABLE `opration_integral_return_spu`
(
    `id`          bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
    `goods_id`    varchar(32) NOT NULL DEFAULT '' COMMENT '商品编号',
    `return_id`   varchar(32) NOT NULL DEFAULT '' COMMENT '商户积分返现编号',
    `create_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
    `update_time` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '促销活动与商品类目对应表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for opration_popularize_commission
-- ----------------------------
DROP TABLE IF EXISTS `opration_popularize_commission`;
CREATE TABLE `opration_popularize_commission`
(
    `id`                       bigint(20) NOT NULL AUTO_INCREMENT COMMENT '会员表自增id',
    `sort`                     tinyint(1) NOT NULL COMMENT '序号',
    `member_level`             tinyint(1) NOT NULL DEFAULT 1 COMMENT '会员等级',
    `register_award`           decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '新人注册奖励（元）',
    `recommend_register_award` decimal(20, 8) NOT NULL DEFAULT 0.00000000 COMMENT '推荐新人注册奖励（元）',
    `create_time`              bigint(20) NOT NULL DEFAULT 0 COMMENT '信息入库时间',
    `update_time`              bigint(20) NOT NULL DEFAULT 0 COMMENT '信息更新时间',
    PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '运营中心-推广佣金' ROW_FORMAT = Dynamic;

DROP TABLE IF EXISTS `user_draw_coin_addr`;
CREATE TABLE `user_draw_coin_addr`
(
    `id`          INT(11) NOT NULL,
    `uid`         VARCHAR(32)  NOT NULL DEFAULT '' COMMENT '用户uid' COLLATE 'utf8mb4_unicode_ci',
    `address`     VARCHAR(255) NOT NULL DEFAULT '' COMMENT '提币地址' COLLATE 'utf8mb4_unicode_ci',
    `remarks`     VARCHAR(200) NOT NULL DEFAULT '' COMMENT '备注' COLLATE 'utf8mb4_unicode_ci',
    `create_time` BIGINT(32) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `update_time` BIGINT(32) NOT NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`)
) COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB
;

SET
FOREIGN_KEY_CHECKS = 1;

-- ----------------------------
-- 2021/12/07Table structure for sys_version
-- ----------------------------
DROP TABLE IF EXISTS `sys_version`;
CREATE TABLE `sys_version`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '版本唯一主键',
  `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '类型  安卓或者iOS',
  `version_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '版本号',
  `force_version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '是否强制更新 1：强制  2：不强制',
  `address` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '地址',
  `create_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `version_code` int(11) NOT NULL DEFAULT 0 COMMENT '版本code',
  `update_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '更新内容',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '版本更新表' ROW_FORMAT = DYNAMIC;

delete from `sys_version` where `type` in('ios', 'android');
INSERT INTO `sys_version`(`id`, `type`, `version_name`, `force_version`, `address`, `create_time`, `version_code`, `update_time`, `content`) VALUES (1, 'ios', '1.0.1', '1.0.1', 'http://d.3appstore.com/smdb', 1626254054976, 0, 1626254054976, '版本内容');
INSERT INTO `sys_version`(`id`, `type`, `version_name`, `force_version`, `address`, `create_time`, `version_code`, `update_time`, `content`) VALUES (2, 'android', '1.0.1', '101', 'https://hlg-data.oss-cn-shanghai.aliyuncs.com/install/android/szbq.apk', 1626254054976, 101, 1626254054976, '版本内容');

ALTER TABLE `goods_spu`
    ADD COLUMN   `nft_file` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'ntf文件';

ALTER TABLE `goods_spu`
    ADD COLUMN   `hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '通邦nfthash';

ALTER TABLE `opration_function`
    ADD COLUMN `param` varchar(500) NOT NULL DEFAULT '' COMMENT '功能区跳转参数';

ALTER TABLE `goods_sku`
    ADD COLUMN `nft_sales_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'nft销售方式（1.原商品销售 2.拷贝销售）';

ALTER TABLE `external_token`
    ADD COLUMN `hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '外部hash表';

ALTER TABLE `external_token`
    ADD COLUMN   `token_id` bigint(32) DEFAULT '0' COMMENT 'nft真实id';
ALTER TABLE `external_token`
    ADD COLUMN   `goods_type` int(32) DEFAULT '0' COMMENT '通证类型 0:FT(ERC20) 1:NFT(ERC721)';
ALTER TABLE `external_token`
    ADD COLUMN   `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '通证名称';
ALTER TABLE `external_token`
    ADD COLUMN   `publish_time` bigint(128) DEFAULT '0' COMMENT '发行时间';
ALTER TABLE `external_token`
    ADD COLUMN     `publisher` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '发行者';
ALTER TABLE `goods_spu` MODIFY   `traceability_number` varchar(1000) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '溯源编号';

-- 20212124
DROP TABLE IF EXISTS `goods_sku_usufruct`;
CREATE TABLE `goods_sku_usufruct` (
                                      `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                                      `prefix` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '使用权前缀',
                                      `serial_no` json DEFAULT NULL COMMENT '序列号',
                                      `create_time` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
                                      `update_time` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
                                      `commodity_pass_id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '编号',
                                      `merchant_id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商户号',
                                      PRIMARY KEY (`id`) USING BTREE

) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='使用权';

ALTER TABLE `order_detail`
 ADD COLUMN `serial_no` JSON NULL DEFAULT NULL COMMENT '序列号' ;

 ALTER TABLE `user_asset`
	ADD COLUMN `goods_coin` VARCHAR(32) NOT NULL DEFAULT '0' COMMENT '商品coin' ;

update user_asset set goods_coin = coin;
ALTER TABLE `user_asset_record` ADD COLUMN  `goods_coin` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品coin';

ALTER TABLE `merchant_integral`
    ADD COLUMN `price` decimal(20,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '行情  1积分=n人民币';

-- 2022-2-
ALTER TABLE `goods_spu`
    ADD COLUMN `sales_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '（销售方式）1.普通 2.盲盒';

ALTER TABLE `goods_sku`
    ADD COLUMN   `is_hide` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否隐藏款（0.否 1.是）';

ALTER TABLE `goods_spu`
    ADD COLUMN   `difficulty` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '盲盒商品难度（1-10）';

ALTER TABLE `goods_spu`
    ADD COLUMN   `blind_box_price` decimal(10,2) unsigned NOT NULL DEFAULT 0 COMMENT '盲盒价格';

ALTER TABLE `goods_sku`
    ADD COLUMN   `token_id` bigint(32) NOT NULL DEFAULT '0' COMMENT 'token_id';

ALTER TABLE `goods_spu`
    ADD COLUMN     `blind_box_rule` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '盲盒规则';

ALTER TABLE `goods_spu`
    ADD COLUMN       `preheat_start_time` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '预热开始时间';

ALTER TABLE `goods_spu`
    ADD COLUMN       `preheat_end_time` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '预热结束时间';


