

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for bot_address
-- ----------------------------
DROP TABLE IF EXISTS `bot_address`;
CREATE TABLE `bot_address`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'tg ID',
  `address` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
  `alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '别名',
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for bot_admin
-- ----------------------------
DROP TABLE IF EXISTS `bot_admin`;
CREATE TABLE `bot_admin`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `password` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `nickname` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `sex` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `cellphone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `email` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '管理员' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of bot_admin
-- ----------------------------
INSERT INTO `bot_admin` VALUES (1, 'admin', '$2y$10$aRuvnclyyJyd7Nu8gDcqg.OBtAkWtZ0luS9Bzz8YD5eh3cJVpjHsy', '管理员', '女', '18888888888', 'admin@163.com', '', '2024-11-27 14:24:35', '2024-11-27 14:20:11');

-- ----------------------------
-- Table structure for bot_balance_logs
-- ----------------------------
DROP TABLE IF EXISTS `bot_balance_logs`;
CREATE TABLE `bot_balance_logs`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `room_id` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '房间号，如果是结算，或其它有房间号相关的，则记录此字段',
  `member_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'tg id',
  `amount` decimal(30, 10) NULL DEFAULT NULL COMMENT '变动金额',
  `before_balance` decimal(30, 10) NULL DEFAULT NULL COMMENT '变动前余额',
  `after_balance` decimal(30, 10) NULL DEFAULT NULL COMMENT '变动后余额',
  `change_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变动类型，如 \"充值\"、\"提现\"、\"结算\" 等',
  `created_at` datetime(0) NULL DEFAULT NULL,
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '变动的描述信息，可以存储一些简短的备注信息',
  `related_id` int(11) NULL DEFAULT NULL COMMENT '相关ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for bot_config
-- ----------------------------
DROP TABLE IF EXISTS `bot_config`;
CREATE TABLE `bot_config`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `field` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `val` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `field`(`field`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of bot_config
-- ----------------------------LOCK TABLES `bot_config` WRITE;
/*!40000 ALTER TABLE `bot_config` DISABLE KEYS */;
INSERT INTO `bot_config` VALUES (3,'service_charge','1','2025-07-07 17:48:06','2025-07-07 17:48:06','提现手续费'),(4,'service_account','oooluckybot','2025-07-07 17:48:06','2025-07-07 17:48:06','客服账号'),(5,'receiving_address','Trftghhnnbg6775tghy678ikuj9807ujht','2025-07-07 17:48:06','2025-07-07 17:48:06','收款地址'),(8,'betting_group','GGGBBBB1','2025-07-07 17:48:06','2025-07-07 17:48:06','投注群'),(9,'rebate','0.01','2025-07-07 17:48:06','2025-07-07 17:48:06','返佣比例'),(10,'official_channel','ABCDE_123y','2025-07-07 17:48:06','2025-07-07 17:48:06','官方频道');
/*!40000 ALTER TABLE `bot_config` ENABLE KEYS */;
UNLOCK TABLES;


-- ----------------------------
-- Table structure for bot_messages
-- ----------------------------
DROP TABLE IF EXISTS `bot_messages`;
CREATE TABLE `bot_messages`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` datetime(0) NULL DEFAULT NULL,
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for bot_room_users
-- ----------------------------
DROP TABLE IF EXISTS `bot_room_users`;
CREATE TABLE `bot_room_users`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `room_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房间号',
  `member_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'tgID',
  `game_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '游戏ID',
  `status` tinyint(1) NULL DEFAULT 0 COMMENT '人员状态\r\n0 待准备\r\n1 已准备\r\n2 游戏中\r\n3 待结算\r\n4 已结算',
  `score` int(11) NULL DEFAULT NULL COMMENT '得分',
  `brokerage` decimal(30, 10) NULL DEFAULT 0.0000000000 COMMENT '抽佣金额',
  `real_score` decimal(30, 10) NULL DEFAULT 0.0000000000 COMMENT '真实金额',
  `screenshot` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '结算截图',
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
ALTER TABLE `bot_room_users` ADD COLUMN `first_name` varchar(255) NULL COMMENT '用户昵称' AFTER `created_at`;
-- ----------------------------
-- Table structure for bot_rooms
-- ----------------------------
DROP TABLE IF EXISTS `bot_rooms`;
CREATE TABLE `bot_rooms`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `room_id` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '房间号',
  `member_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '房主ID',
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  `status` tinyint(1) NULL DEFAULT 0 COMMENT '房间状态\r\n0 创建中\r\n1 创建完成\r\n2 游戏中\r\n3 已结算\r\n4 异常\r\n5 解散',
  `game_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '游戏名称',
  `base_score` int(11) NULL DEFAULT 0 COMMENT '底分',
  `participants` int(11) NULL DEFAULT 0 COMMENT '人数',
  `rounds` int(11) NULL DEFAULT 0 COMMENT '局数',
  `join_count` int(11) NULL DEFAULT 0 COMMENT '已加入人数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

ALTER TABLE `bot_rooms` ADD COLUMN `introduction` varchar(255) NULL DEFAULT '' COMMENT '游戏介绍' AFTER `join_count`;

ALTER TABLE `bot_rooms`
ADD COLUMN `old_room_id`  varchar(16) NULL COMMENT '原房号' AFTER `join_count`;
ALTER TABLE `bot_rooms`
ADD COLUMN `midway`  tinyint(1) NULL DEFAULT 0 COMMENT '中途加入游戏 1-允许' AFTER `old_room_id`;

ALTER TABLE `bot_rooms`
ADD COLUMN `settle_status`  tinyint(1) NULL DEFAULT 0 COMMENT '结算通知:1=已通知' AFTER `midway`;

-- ----------------------------
-- Table structure for bot_users
-- ----------------------------
DROP TABLE IF EXISTS `bot_users`;
CREATE TABLE `bot_users`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户ID',
  `first_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户昵称',
  `created_at` datetime(0) NULL DEFAULT NULL,
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `usdt` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'USDT地址',
  `game_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '游戏ID',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `member_id`(`member_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for bot_withdraws
-- ----------------------------
DROP TABLE IF EXISTS `bot_withdraws`;
CREATE TABLE `bot_withdraws`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'tg_id',
  `amount` decimal(30, 10) NULL DEFAULT NULL COMMENT '提现金额',
  `service_charge` decimal(30, 10) NULL DEFAULT NULL COMMENT '手续费',
  `to_account` decimal(30, 10) NULL DEFAULT NULL COMMENT '到账金额',
  `after_balance` decimal(30, 10) NULL DEFAULT NULL COMMENT '提现后余额',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '提现地址',
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  `status` tinyint(1) NULL DEFAULT 0 COMMENT '状态\r\n0 申请中\r\n1 成功\r\n2 失败',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '失败备注',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;


-- ----------------------------
-- Table structure for bot_coins
-- ----------------------------
DROP TABLE IF EXISTS `bot_coins`;
CREATE TABLE `bot_coins` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `coin` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `net` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `min_exchange_amount` decimal(30,10) NOT NULL DEFAULT '10.0000000000' COMMENT '最低闪兑金额',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of bot_coins
-- ----------------------------
INSERT INTO `bot_coins` VALUES ('1', 'USDT', 'TRC20', 'TGQaMxtyWeGowy8xqwh98JNNLtc77nzZ8M', null, '2025-05-20 09:33:30', '1.0000000000');


-- ----------------------------
-- Table structure for bot_wallets
-- ----------------------------
DROP TABLE IF EXISTS `bot_wallets`;
CREATE TABLE `bot_wallets` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
  `member_id` bigint(20) DEFAULT NULL COMMENT 'TGID',
  `coin` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '币种ID',
  `net` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '网络类型',
  `address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '链上钱包地址',
  `private_key` text COLLATE utf8mb4_unicode_ci COMMENT '钱包私钥（加密后）',
  `available_balance` decimal(30,10) NOT NULL DEFAULT '0.0000000000' COMMENT '可用余额',
  `frozen_balance` decimal(30,10) NOT NULL DEFAULT '0.0000000000' COMMENT '冻结余额',
  `total_balance` decimal(30,10) NOT NULL DEFAULT '0.0000000000' COMMENT '总余额',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `wallets_user_id_index` (`user_id`),
  KEY `wallets_coin_id_index` (`coin`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

DROP TABLE IF EXISTS `bot_recharges`;
CREATE TABLE `bot_recharges` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `member_id` bigint(20) DEFAULT NULL COMMENT '会员ID',
  `net` varchar(50) DEFAULT NULL COMMENT '链接类型',
  `coin` varchar(50) DEFAULT NULL COMMENT '币种',
  `amount` decimal(30,10) DEFAULT NULL COMMENT '充值数量',
  `to_address` varchar(100) DEFAULT NULL COMMENT '充值地址（平台地址）',
  `from_address` varchar(100) DEFAULT NULL COMMENT '转出地址（用户发起地址）',
  `txid` varchar(100) DEFAULT NULL COMMENT '链上交易哈希',
  `block_time` int(11) DEFAULT NULL COMMENT '区块时间',
  `block_height` bigint(20) DEFAULT NULL,
  `confirmations` int(11) DEFAULT '0' COMMENT '确认数',
  `status` tinyint(2) DEFAULT '0' COMMENT '状态：0=待确认，1=已确认，2=失败，3=已忽略',
  `created_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_txid` (`txid`) USING BTREE,
  KEY `re_to_address` (`to_address`) USING BTREE,
  KEY `re_member_id` (`member_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
ALTER TABLE `bot_recharges`
ADD COLUMN `type`  tinyint(1) NULL DEFAULT 1 COMMENT '充值类型:1=自动,2=手动' AFTER `status`;
ALTER TABLE `bot_recharges`
ADD COLUMN `image`  varchar(255) NULL COMMENT '充值图片' AFTER `type`;

DROP TABLE IF EXISTS `bot_collects`;
CREATE TABLE `bot_collects` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `coin` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '币种',
  `net` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '网络',
  `from_address` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '归集来源地址',
  `to_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '归集目标地址（主钱包）',
  `amount` decimal(36,18) NOT NULL COMMENT '归集金额（USDT）',
  `fee` decimal(36,18) DEFAULT '0.000000000000000000' COMMENT '交易手续费（TRX）',
  `txid` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '链上交易哈希',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态：0待处理，1已发起，2已确认，3失败',
  `confirmations` int(11) DEFAULT '0' COMMENT '确认数',
  `block_number` bigint(20) DEFAULT NULL COMMENT '交易所在区块高度',
  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注信息',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_from_address` (`from_address`),
  KEY `idx_to_address` (`to_address`),
  KEY `idx_txid` (`txid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='归集记录表';

DROP TABLE IF EXISTS `bot_roles`;
CREATE TABLE `bot_roles` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT COMMENT '角色ID',
  `name` VARCHAR(50) NOT NULL UNIQUE COMMENT '角色标识（英文唯一）',
  `display_name` VARCHAR(100) DEFAULT NULL COMMENT '角色名称（显示用）',
  `description` TEXT COMMENT '角色描述',
  `created_at` TIMESTAMP NULL DEFAULT NULL,
  `updated_at` TIMESTAMP NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) COMMENT='角色表';
ALTER TABLE `bot_roles`
MODIFY COLUMN `name`  varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '角色标识（英文唯一）' AFTER `id`;


DROP TABLE IF EXISTS `bot_permissions`;
CREATE TABLE `bot_permissions` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT COMMENT '权限ID',
  `name` VARCHAR(100) NOT NULL UNIQUE COMMENT '权限标识（英文唯一）',
  `display_name` VARCHAR(100) DEFAULT NULL COMMENT '权限名称（显示用）',
  `description` TEXT COMMENT '权限描述',
  `created_at` TIMESTAMP NULL DEFAULT NULL,
  `updated_at` TIMESTAMP NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) COMMENT='权限表';

DROP TABLE IF EXISTS `bot_permission_role`;
CREATE TABLE `bot_permission_role` (
  `permission_id` BIGINT UNSIGNED NOT NULL COMMENT '权限ID',
  `role_id` BIGINT UNSIGNED NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`permission_id`, `role_id`)
) COMMENT='权限与角色关联表';

DROP TABLE IF EXISTS `bot_role_menu`;
CREATE TABLE `bot_role_menu` (
  `menu_id` bigint(20) unsigned NOT NULL COMMENT '菜单ID',
  `role_id` bigint(20) unsigned NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`menu_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='菜单与角色关联表';

DROP TABLE IF EXISTS `bot_role_user`;
CREATE TABLE `bot_role_user` (
  `user_id` BIGINT UNSIGNED NOT NULL COMMENT '用户ID',
  `role_id` BIGINT UNSIGNED NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`user_id`, `role_id`)
) COMMENT='用户与角色关联表';


DROP TABLE IF EXISTS `bot_menus`;
CREATE TABLE `bot_menus` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT COMMENT '菜单ID',
  `parent_id` BIGINT UNSIGNED DEFAULT 0 COMMENT '父级菜单ID',
  `title` VARCHAR(100) NOT NULL COMMENT '菜单名称',
  `icon` VARCHAR(50) DEFAULT NULL COMMENT '菜单图标',
  `uri` VARCHAR(255) DEFAULT NULL COMMENT '菜单链接地址/路由',
  `permission_name` VARCHAR(100) DEFAULT NULL COMMENT '绑定权限标识（name）',
  `sort` INT DEFAULT 0 COMMENT '排序值（越小越靠前）',
  `created_at` TIMESTAMP NULL DEFAULT NULL,
  `updated_at` TIMESTAMP NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) COMMENT='菜单表';
ALTER TABLE `bot_menus`
ADD COLUMN `status`  tinyint(1) NULL DEFAULT 1 COMMENT '是否可见：1=显示，2=隐藏' AFTER `sort`,
ADD COLUMN `type`  tinyint(1) NULL DEFAULT 1 COMMENT '类型:1=菜单,2=按钮' AFTER `status`;

INSERT INTO `bot_menus` VALUES ('1', '0', '会员列表', null, '/', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('2', '0', '充值列表', null, 'wallet/topUp', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('3', '40', '游戏房间', null, 'room', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('4', '0', '提现列表', null, 'withdraw/list', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('5', '0', '钱包记录', null, 'balance/log', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('6', '0', '所有配置', null, 'config', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('7', '6', '所有配置', null, 'getAll', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('8', '6', '频道管理', null, 'Message', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('9', '0', '权限管理', null, '/authority', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('10', '9', '账号管理', null, 'account', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('11', '9', '角色管理', null, 'role', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('12', '9', '菜单管理', null, 'menu', null, '0', '1', '1', null, null);

INSERT INTO `bot_menus` VALUES ('13', '10', '账号列表', null, 'admin/index', null, '0', '1', '2', '2025-07-30 15:46:37', '2025-07-30 15:46:37');
INSERT INTO `bot_menus` VALUES ('14', '10', '账号修改', null, 'admin/submit', null, '0', '1', '2', '2025-07-30 15:47:15', '2025-07-30 15:47:15');
INSERT INTO `bot_menus` VALUES ('15', '10', '账号删除', null, 'admin/delete', null, '0', '1', '2', '2025-07-30 15:47:50', '2025-07-30 15:47:50');
INSERT INTO `bot_menus` VALUES ('16', '4', '提现列表', null, 'admin/withdraw', null, '0', '1', '2', '2025-07-30 15:50:14', '2025-07-30 15:50:14');
INSERT INTO `bot_menus` VALUES ('17', '4', '提现审核', null, 'admin/withdraw/setStatus', null, '0', '1', '2', '2025-07-30 15:50:57', '2025-07-30 15:50:57');
INSERT INTO `bot_menus` VALUES ('18', '3', '游戏房间列表', null, 'admin/room', null, '0', '1', '2', '2025-07-30 15:52:28', '2025-07-30 15:52:28');
INSERT INTO `bot_menus` VALUES ('19', '3', '对局详情', null, 'admin/room/details', null, '0', '1', '2', '2025-07-30 15:53:10', '2025-07-30 15:53:10');
INSERT INTO `bot_menus` VALUES ('20', '3', '设置用户得分', null, 'admin/room/setScore', null, '0', '1', '2', '2025-07-30 15:53:40', '2025-07-30 15:53:40');
INSERT INTO `bot_menus` VALUES ('21', '3', '结算', null, 'admin/room/completed', null, '0', '1', '2', '2025-07-30 15:54:01', '2025-07-30 15:54:01');
INSERT INTO `bot_menus` VALUES ('22', '7', '获取所有配置', null, 'admin/config/getAll', null, '0', '1', '2', '2025-07-30 15:57:10', '2025-07-30 15:57:10');
INSERT INTO `bot_menus` VALUES ('23', '7', '修改配置', null, 'admin/config/set', null, '0', '1', '2', '2025-07-30 15:57:56', '2025-07-30 15:57:56');
INSERT INTO `bot_menus` VALUES ('24', '8', '获取指定配置', null, 'admin/config/get', null, '0', '1', '2', '2025-07-30 15:59:12', '2025-07-30 15:59:12');
INSERT INTO `bot_menus` VALUES ('25', '8', '发送频道消息', null, 'admin/config/sendChannelMessage', null, '0', '1', '2', '2025-07-30 15:59:57', '2025-07-30 15:59:57');
INSERT INTO `bot_menus` VALUES ('26', '5', '钱包记录', null, 'admin/balance/log', null, '0', '1', '2', '2025-07-30 16:01:43', '2025-07-30 16:01:43');
INSERT INTO `bot_menus` VALUES ('27', '2', '充值列表', null, 'admin/wallet', null, '0', '1', '2', '2025-07-30 16:05:07', '2025-07-30 16:05:07');
INSERT INTO `bot_menus` VALUES ('28', '1', '人工充值', null, 'admin/wallet/topUp', null, '0', '1', '2', '2025-07-30 16:07:01', '2025-07-30 16:07:01');
INSERT INTO `bot_menus` VALUES ('29', '2', '充值审核', null, 'admin/wallet/verifyRecharge', null, '0', '1', '2', '2025-07-30 16:08:07', '2025-07-30 16:08:07');
INSERT INTO `bot_menus` VALUES ('30', '1', '会员列表', null, 'admin/user', null, '0', '1', '2', '2025-07-30 16:09:09', '2025-07-30 16:09:09');
INSERT INTO `bot_menus` VALUES ('31', '12', '菜单列表', null, 'admin/menu', null, '0', '1', '2', '2025-07-30 16:09:45', '2025-07-30 16:09:45');
INSERT INTO `bot_menus` VALUES ('32', '12', '菜单修改', null, 'admin/menu/submit', null, '0', '1', '2', '2025-07-30 16:10:18', '2025-07-30 16:10:18');
INSERT INTO `bot_menus` VALUES ('33', '12', '菜单删除', null, 'admin/menu/delete', null, '0', '1', '2', '2025-07-30 16:10:43', '2025-07-30 16:10:43');
INSERT INTO `bot_menus` VALUES ('34', '12', '所有菜单', null, 'admin/menu/all', null, '0', '1', '2', '2025-07-30 16:11:20', '2025-07-30 16:11:20');
INSERT INTO `bot_menus` VALUES ('35', '11', '角色列表', null, 'admin/role', null, '0', '1', '2', '2025-07-30 16:13:21', '2025-07-30 16:13:21');
INSERT INTO `bot_menus` VALUES ('36', '11', '角色修改', null, 'admin/role/submit', null, '0', '1', '2', '2025-07-30 16:14:14', '2025-07-30 16:14:14');
INSERT INTO `bot_menus` VALUES ('37', '11', '角色删除', null, 'admin/role/delete', null, '0', '1', '2', '2025-07-30 16:14:26', '2025-07-30 16:14:26');
INSERT INTO `bot_menus` VALUES ('38', '11', '所有角色', null, 'admin/role/all', null, '0', '1', '2', '2025-07-30 16:14:38', '2025-07-30 16:14:38');

INSERT INTO `bot_menus` VALUES ('40', '0', '房间管理', null, '/chamber', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('41', '0', '游戏管理', null, 'game', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('42', '0', '期数管理', null, 'certification', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('43', '0', '回复管理', null, 'reply/list', null, '0', '1', '1', null, null);
INSERT INTO `bot_menus` VALUES ('44', '0', '玩法管理', null, 'replying/list', null, '0', '2', '1', null, null);
INSERT INTO `bot_menus` VALUES ('45', '0', '配置列表', null, 'list', null, '0', '1', '1', null, null);

-- ----------------------------
-- Table structure for bot_games
-- ----------------------------
DROP TABLE IF EXISTS `bot_games`;
CREATE TABLE `bot_games`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `game_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '游戏名称',
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `game_name`(`game_name`) USING BTREE COMMENT '游戏名称唯一'
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for bot_user_game
-- ----------------------------
DROP TABLE IF EXISTS `bot_user_game`;
CREATE TABLE `bot_user_game`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `game_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '游戏名称',
  `game_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '游戏ID',
  `member_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户ID',
  `updated_at` datetime(0) NULL DEFAULT NULL,
  `created_at` datetime(0) NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;


-- ----------------------------
-- Table structure for bot_gameplay_rules
-- ----------------------------
DROP TABLE IF EXISTS `bot_gameplay_rules`;
CREATE TABLE `bot_gameplay_rules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `maxinum` bigint(20) DEFAULT '0' COMMENT '最高',
  `mininum` bigint(20) DEFAULT '0' COMMENT '最低',
  `odds` decimal(10,2) DEFAULT '1.00' COMMENT '赔率',
  `groups` varchar(50) DEFAULT NULL COMMENT '规则分组',
  `keywords` varchar(50) DEFAULT NULL COMMENT '玩法关键字',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='玩法规则';


LOCK TABLES `bot_gameplay_rules` WRITE;
/*!40000 ALTER TABLE `bot_gameplay_rules` DISABLE KEYS */;
INSERT INTO `bot_gameplay_rules` VALUES (1,100000,10,1.98,'总和','大','2025-08-15 16:47:38','2025-08-15 16:47:38'),(2,100000,10,1.98,'总和','小','2025-08-15 16:48:10','2025-08-15 16:48:10'),(3,100000,10,1.98,'总和','单','2025-08-15 16:48:16','2025-08-15 16:48:16'),(4,100000,10,1.98,'总和','双','2025-08-15 16:48:35','2025-08-15 16:48:35'),(5,50000,10,4.28,'总和','大单','2025-08-15 16:50:16','2025-08-15 16:50:16'),(6,50000,10,3.68,'总和','大双','2025-08-15 16:50:22','2025-08-15 16:50:22'),(7,50000,10,3.68,'总和','小单','2025-08-15 16:50:28','2025-08-15 16:50:28'),(8,50000,10,4.28,'总和','小双','2025-08-15 16:50:33','2025-08-15 16:50:33'),(9,10000,10,15.00,'总和','极大','2025-08-15 16:52:02','2025-08-15 16:52:02'),(10,10000,10,15.00,'总和','极小','2025-08-15 16:52:36','2025-08-15 16:52:36'),(11,10000,10,3.50,'总和','对子','2025-08-15 16:55:33','2025-08-15 16:55:33'),(12,10000,10,15.00,'总和','顺子','2025-08-15 16:55:45','2025-08-15 16:55:45'),(13,10000,10,88.00,'总和','豹子','2025-08-15 16:55:51','2025-08-15 16:55:51'),(14,1000,10,918.00,'总和','0操','2025-08-15 16:58:19','2025-08-15 16:58:19'),(15,1000,10,918.00,'总和','27操','2025-08-15 16:58:31','2025-09-18 15:44:28'),(16,10000,10,300.00,'总和','1操','2025-09-15 17:05:18','2025-09-15 17:05:18'),(17,10000,10,300.00,'总和','26操','2025-09-15 17:06:16','2025-09-15 17:06:16'),(18,10000,10,150.00,'总和','2操','2025-09-15 17:06:51','2025-09-15 17:06:51'),(19,10000,10,150.00,'总和','25操','2025-09-15 17:06:55','2025-09-15 17:06:55'),(20,10000,10,90.00,'总和','3操','2025-09-15 17:07:12','2025-09-15 17:07:12'),(21,10000,10,90.00,'总和','24操','2025-09-15 17:07:16','2025-09-15 17:07:16'),(22,10000,10,58.00,'总和','4操','2025-09-15 17:07:57','2025-09-15 17:07:57'),(23,10000,10,58.00,'总和','23操','2025-09-15 17:08:04','2025-09-15 17:08:04'),(24,10000,10,44.00,'总和','5操','2025-09-15 17:08:15','2025-09-15 17:08:15'),(25,10000,10,44.00,'总和','22操','2025-09-15 17:08:49','2025-09-15 17:08:49'),(26,10000,10,33.00,'总和','6操','2025-09-15 17:09:00','2025-09-15 17:09:00'),(27,10000,10,33.00,'总和','21操','2025-09-15 17:09:05','2025-09-15 17:09:05'),(28,10000,10,25.00,'总和','7操','2025-09-15 17:10:05','2025-09-15 17:10:05'),(29,10000,10,25.00,'总和','20操','2025-09-15 17:10:09','2025-09-15 17:10:09'),(30,10000,10,20.00,'总和','8操','2025-09-15 17:10:21','2025-09-15 17:10:21'),(31,10000,10,20.00,'总和','19操','2025-09-15 17:10:25','2025-09-15 17:10:25'),(32,10000,10,16.00,'总和','9操','2025-09-15 17:10:34','2025-09-15 17:10:34'),(33,10000,10,16.00,'总和','18操','2025-09-15 17:10:37','2025-09-15 17:10:37'),(34,10000,10,14.00,'总和','10操','2025-09-15 17:10:47','2025-09-15 17:10:47'),(35,10000,10,14.00,'总和','17操','2025-09-15 17:10:50','2025-09-15 17:10:50'),(36,10000,10,13.00,'总和','11操','2025-09-15 17:10:58','2025-09-15 17:10:58'),(37,10000,10,13.00,'总和','16操','2025-09-15 17:11:02','2025-09-15 17:11:02'),(38,10000,10,12.00,'总和','12操','2025-09-15 17:11:20','2025-09-15 17:11:20'),(39,10000,10,12.00,'总和','15操','2025-09-15 17:11:24','2025-09-15 17:11:24'),(40,10000,10,12.00,'总和','13操','2025-09-15 17:11:33','2025-09-15 17:11:33'),(41,10000,10,12.00,'总和','14操','2025-09-15 17:11:38','2025-09-15 17:11:38'),(42,100000,10,2.40,'尾数','尾大','2025-09-15 17:14:01','2025-09-15 17:14:01'),(43,100000,10,2.40,'尾数','尾小','2025-09-15 17:14:06','2025-09-15 17:14:06'),(44,100000,10,2.40,'尾数','尾单','2025-09-15 17:14:14','2025-09-15 17:14:14'),(45,100000,10,2.40,'尾数','尾双','2025-09-15 17:14:17','2025-09-15 17:14:17'),(46,80000,10,4.80,'尾数','尾大单','2025-09-15 17:14:30','2025-09-15 17:14:30'),(47,80000,10,4.80,'尾数','尾小单','2025-09-15 17:14:34','2025-09-15 17:14:34'),(48,80000,10,4.80,'尾数','尾大双','2025-09-15 17:14:49','2025-09-15 17:14:49'),(49,80000,10,4.80,'尾数','尾小双','2025-09-15 17:14:53','2025-09-15 17:14:53'),(50,10000,10,8.00,'尾数','1尾','2025-09-15 17:16:59','2025-09-15 17:16:59'),(51,10000,10,8.00,'尾数','8尾','2025-09-15 17:17:04','2025-09-15 17:17:04'),(52,10000,10,0.00,'尾数','0尾','2025-09-15 17:17:10','2025-09-15 17:17:10'),(53,10000,10,0.00,'尾数','9尾','2025-09-15 17:17:14','2025-09-15 17:17:14'),(54,10000,10,8.00,'尾数','2尾','2025-09-15 17:17:38','2025-09-15 17:17:38'),(55,10000,10,8.00,'尾数','3尾','2025-09-15 17:17:41','2025-09-15 17:17:41'),(56,10000,10,8.00,'尾数','4尾','2025-09-15 17:17:44','2025-09-15 17:17:44'),(57,10000,10,8.00,'尾数','5尾','2025-09-15 17:17:47','2025-09-15 17:17:47'),(58,10000,10,8.00,'尾数','6尾','2025-09-15 17:17:51','2025-09-15 17:17:51'),(59,10000,10,8.00,'尾数','7尾','2025-09-15 17:17:54','2025-09-15 17:17:54'),(61,10000,10,2.40,'个位','A大','2025-09-18 15:56:34','2025-09-18 15:56:34'),(62,10000,10,2.40,'个位','A小','2025-09-18 15:57:03','2025-09-18 15:57:03'),(63,10000,10,2.40,'个位','A单','2025-09-18 16:01:14','2025-09-18 16:01:14'),(64,10000,10,2.40,'个位','A双','2025-09-18 16:01:37','2025-09-18 16:01:37'),(65,10000,10,2.40,'个位','B大','2025-09-18 16:03:28','2025-09-18 16:03:28'),(66,10000,10,2.40,'个位','B小','2025-09-18 16:03:46','2025-09-18 16:03:46'),(67,10000,10,2.40,'个位','B单','2025-09-18 16:05:07','2025-09-18 16:05:07'),(68,10000,10,2.40,'个位','B双','2025-09-18 16:05:23','2025-09-18 16:05:23'),(69,10000,10,2.40,'个位','C大','2025-09-18 16:05:52','2025-09-18 16:05:52'),(70,10000,10,2.40,'个位','C小','2025-09-18 16:06:29','2025-09-18 16:06:29'),(71,10000,10,2.40,'个位','C单','2025-09-18 16:06:44','2025-09-18 16:06:44'),(72,10000,10,2.40,'个位','C双','2025-09-18 16:07:06','2025-09-18 16:07:06'),(73,10000,10,9.80,'个位','0A','2025-09-18 16:18:40','2025-09-18 16:18:40'),(74,10000,10,9.80,'个位','1A','2025-09-18 16:19:03','2025-09-18 16:19:03'),(75,10000,10,9.80,'个位','2A','2025-09-18 16:20:40','2025-09-18 16:20:40'),(76,10000,10,9.80,'个位','3A','2025-09-18 16:21:17','2025-09-18 16:21:17'),(77,10000,10,9.80,'个位','4A','2025-09-18 16:21:40','2025-09-18 16:21:40'),(78,10000,10,9.80,'个位','5A','2025-09-18 16:22:48','2025-09-18 16:22:48'),(79,10000,10,9.80,'个位','6A','2025-09-18 16:23:50','2025-09-18 16:23:50'),(80,10000,10,9.80,'个位','7A','2025-09-18 16:38:55','2025-09-18 16:38:55'),(81,10000,10,9.80,'个位','8A','2025-09-18 16:39:11','2025-09-18 16:39:11'),(82,10000,10,9.80,'个位','9A','2025-09-18 16:39:29','2025-09-18 16:39:29'),(83,10000,10,9.80,'个位','0B','2025-09-18 16:42:53','2025-09-18 16:43:07'),(84,10000,10,9.80,'个位','1B','2025-09-18 16:44:45','2025-09-18 16:44:45'),(85,10000,10,9.80,'个位','2B','2025-09-18 16:51:59','2025-09-18 16:51:59'),(86,10000,10,9.80,'个位','3B','2025-09-18 16:52:19','2025-09-18 16:52:19'),(87,10000,10,9.80,'个位','4B','2025-09-18 16:54:03','2025-09-18 16:54:03'),(88,10000,10,9.80,'个位','5B','2025-09-18 16:54:24','2025-09-18 16:54:24'),(89,10000,10,9.80,'个位','6B','2025-09-18 16:54:42','2025-09-18 16:54:42'),(90,10000,10,9.80,'个位','7B','2025-09-18 16:56:34','2025-09-18 16:56:34'),(91,10000,10,9.80,'个位','8B','2025-09-18 16:57:14','2025-09-18 16:57:14'),(92,10000,10,9.80,'个位','9B','2025-09-18 16:57:39','2025-09-18 16:57:39'),(93,10000,10,9.80,'个位','0C','2025-09-18 16:59:13','2025-09-18 16:59:13'),(94,10000,10,9.80,'个位','1C','2025-09-18 16:59:29','2025-09-18 16:59:29'),(95,10000,10,9.80,'个位','2C','2025-09-18 16:59:51','2025-09-18 16:59:51'),(96,10000,10,9.80,'个位','3C','2025-09-18 17:00:09','2025-09-18 17:00:09'),(97,10000,10,9.80,'个位','4C','2025-09-18 17:00:29','2025-09-18 17:00:29'),(98,10000,10,9.80,'个位','5C','2025-09-18 17:00:55','2025-09-18 17:00:55'),(99,10000,10,9.80,'个位','6C','2025-09-18 17:01:11','2025-09-18 17:01:11'),(100,10000,10,9.80,'个位','7C','2025-09-18 17:02:50','2025-09-18 17:02:50'),(101,10000,10,9.80,'个位','8C','2025-09-18 17:03:08','2025-09-18 17:03:08'),(102,10000,10,9.80,'个位','9C','2025-09-18 17:03:29','2025-09-18 17:03:29'),(103,100000,10,4.10,'多段','一段','2025-09-18 17:09:45','2025-09-18 17:09:45'),(104,100000,10,4.30,'多段','二段','2025-09-18 17:10:09','2025-09-18 17:10:09'),(105,100000,10,4.30,'多段','三段','2025-09-18 17:10:32','2025-09-18 17:10:32'),(106,100000,10,4.10,'多段','四段','2025-09-18 17:10:55','2025-09-18 17:10:55');
/*!40000 ALTER TABLE `bot_gameplay_rules` ENABLE KEYS */;
UNLOCK TABLES;

-- ----------------------------
-- Table structure for bot_bets
-- ----------------------------
DROP TABLE IF EXISTS `bot_bets`;
CREATE TABLE `bot_bets` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `issue_id` int(11) DEFAULT NULL COMMENT '投注ID',
  `issue_no` varchar(50) DEFAULT NULL COMMENT '投注期号',
  `member_id` varchar(40) DEFAULT NULL COMMENT '飞机ID',
  `user_id` int(11) DEFAULT NULL COMMENT '用户ID',
  `keywords` varchar(50) DEFAULT NULL COMMENT '玩法',
  `amount` decimal(20,2) DEFAULT '0.00' COMMENT '下分',
  `odds` decimal(10,2) DEFAULT '1.00' COMMENT '倍率',
  `status` tinyint(2) DEFAULT '1' COMMENT '状态:1-待结算,2-已结算',
  `profit` decimal(20,2) DEFAULT '0.00' COMMENT '利润',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for bot_issues
-- ----------------------------
DROP TABLE IF EXISTS `bot_issues`;
CREATE TABLE `bot_issues` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `issue_no` varchar(50) DEFAULT NULL COMMENT '期号',
  `start_time` datetime DEFAULT NULL COMMENT '开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '截止时间',
  `winning_numbers` varchar(100) DEFAULT NULL COMMENT '中奖号码 按顺序 1,8,6',
  `status` tinyint(2) DEFAULT '1' COMMENT '状态：0-待发布,1-投注中,2-封盘,3-开奖',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

ALTER TABLE `bot_issues`
ADD COLUMN `combo`  varchar(20) NULL AFTER `updated_at`,
ADD COLUMN `extreme`  varchar(20) NULL COMMENT '极值' AFTER `combo`;
ALTER TABLE `bot_issues`
ADD COLUMN `image`  varchar(255) NULL COMMENT '开奖图片' AFTER `extreme`;


-- ----------------------------
-- Table structure for bot_keyboard
-- ----------------------------
DROP TABLE IF EXISTS `bot_keyboard`;
CREATE TABLE `bot_keyboard` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `button` varchar(50) DEFAULT NULL COMMENT '按钮',
  `image` varchar(255) DEFAULT NULL COMMENT '图片',
  `reply` text COMMENT '回复',
  `buttons` text COMMENT '按钮组',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

SET FOREIGN_KEY_CHECKS = 1;

