CREATE TABLE `xq_activity_shop`
(
    `id`               bigint(20) unsigned NOT NULL,
    `activity_title`   varchar(200)        NOT NULL COMMENT '活动标题',
    `activity_banner`  varchar(200)        NOT NULL COMMENT '活动展示图片',
    `start_time`       datetime            NOT NULL COMMENT '开始时间',
    `end_time`         datetime            NOT NULL COMMENT '结束时间',
    `city_name`        varchar(100)        NOT NULL COMMENT '城市名称',
    `city_code`        int(8)              NOT NULL COMMENT '城市编码',
    `address`          varchar(100)        NOT NULL COMMENT '详细地址',
    `activity_text`    text                NOT NULL COMMENT '活动详细说明',
    `women_max_num`    int(8)              NOT NULL COMMENT '女生人数上限',
    `man_max_num`      int(8)              NOT NULL COMMENT '男生人数上限',
    `join_women_num`   int(8)              NOT NULL DEFAULT 0 COMMENT '报名参加女生人数',
    `join_man_num`     int(8)              NOT NULL DEFAULT 0 COMMENT '报名参加男生人数',
    `hand_man_num`     int(8)              NOT NULL DEFAULT 0 COMMENT '手动调整男生人数',
    `hand_women_num`   int(8)              NOT NULL DEFAULT 0 COMMENT '手动调整女生人数',
    `join_women_price` decimal(20, 2)      NOT NULL DEFAULT 0 COMMENT '女生参与价格',
    `join_man_price`   decimal(20, 2)      NOT NULL DEFAULT 0 COMMENT '男生参与价格',
    `must_vip`         tinyint(1)          NOT NULL DEFAULT 0 COMMENT '必须强制会员参与',
    `must_auth`        tinyint(1)          NOT NULL DEFAULT 0 COMMENT '必须强制实名用户参与',
    `price_text`       varchar(100)        NOT NULL COMMENT '费用说明',
    `create_time`      datetime            NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`      datetime                     DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    KEY `idx_start_time` (`start_time`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  ROW_FORMAT = DYNAMIC COMMENT ='相亲会活动';

CREATE TABLE `xq_activity_order`
(
    `id`             bigint(20) unsigned NOT NULL,
    `user_id`        bigint(20)          NOT NULL COMMENT '用户ID',
    `usercode`       varchar(10)         NOT NULL COMMENT '用户号',
    `trace_id`       varchar(36)                  DEFAULT NULL COMMENT '跟踪ID',
    `body`           varchar(255)                 DEFAULT NULL COMMENT '下单body',
    `price`          decimal(10, 2)      NOT NULL DEFAULT '0.00',
    `activity_id`    bigint(20) unsigned NOT NULL COMMENT '活动ID',
    `activity_title` varchar(200)        NOT NULL COMMENT '活动标题',
    `order_name`     varchar(255)                 DEFAULT NULL COMMENT '订单说明',
    `order_no`       varchar(64)         NOT NULL COMMENT '订单号',
    `platform_type`  varchar(20)                  DEFAULT NULL COMMENT '平台',
    `pay_status`     tinyint(1)          NOT NULL DEFAULT '0' COMMENT '状态 0-待支付 1-已支付 5-已退款 10-无需支付',
    `pay_time`       datetime                     DEFAULT NULL COMMENT '支付时间',
    `appid`          varchar(50)                  DEFAULT NULL COMMENT 'appId',
    `return_content` text,
    `operate_ip`     varchar(20)                  DEFAULT '',
    `admin_id`       bigint(20)                   DEFAULT NULL COMMENT '后台操作管理员ID',
    `create_time`    datetime            NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time`    datetime                     DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    KEY `order_no` (`order_no`) USING BTREE,
    KEY `user_id_2` (`user_id`, `pay_status`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  ROW_FORMAT = DYNAMIC COMMENT ='相亲会订单';


CREATE TABLE `xq_activity_user`
(
    `id`          bigint(20) unsigned NOT NULL,
    `activity_id` bigint(20) unsigned NOT NULL COMMENT '活动ID',
    `user_id`     bigint(20)          NOT NULL COMMENT '用户ID',
    `usercode`    varchar(10)         NOT NULL COMMENT '用户号',
    `mobile`      varchar(100)        NOT NULL COMMENT '填写的手机号',
    `pay`         tinyint(1)          NOT NULL COMMENT '是否付钱',
    `price`       decimal(20, 2)      NOT NULL DEFAULT 0 COMMENT '参与价格',
    `trace_id`    varchar(36)                  DEFAULT NULL COMMENT '跟踪ID',
    `create_time` datetime            NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime                     DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    KEY `idx_activity_id` (`activity_id`) USING BTREE,
    KEY `idx_user_id` (`user_id`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  ROW_FORMAT = DYNAMIC COMMENT ='相亲会参与人名单';
