/*
 Navicat MySQL Data Transfer

 Source Server         : smartvuene
 Source Server Type    : MySQL
 Source Server Version : 50723
 Source Host           : 120.27.209.4:3306
 Source Schema         : smart_venue

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

 Date: 26/08/2019 17:44:17
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sv_about_us
-- ----------------------------
DROP TABLE IF EXISTS `sv_about_us`;
CREATE TABLE `sv_about_us` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `image` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT 'logo',
  `description` longtext CHARACTER SET utf8mb4 NOT NULL COMMENT '简介',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='关于我们';

-- ----------------------------
-- Table structure for sv_announcement
-- ----------------------------
DROP TABLE IF EXISTS `sv_announcement`;
CREATE TABLE `sv_announcement` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `tag` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT '标签',
  `title` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT '标题',
  `description` longtext CHARACTER SET utf8mb4 NOT NULL COMMENT '公告介绍',
  `time` date NOT NULL COMMENT '时间',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  `content` varchar(300) CHARACTER SET utf8mb4 NOT NULL COMMENT '短文介绍',
  `image` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '图片image',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='公告';

-- ----------------------------
-- Table structure for sv_coach
-- ----------------------------
DROP TABLE IF EXISTS `sv_coach`;
CREATE TABLE `sv_coach` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `nickname` varchar(100) DEFAULT NULL COMMENT '昵称',
  `avatar` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '图像',
  `content` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '短文介绍',
  `description` longtext CHARACTER SET utf8mb4 NOT NULL COMMENT '介绍',
  `qr_code` varchar(200) DEFAULT NULL COMMENT '二维码',
  `wechat_code` varchar(200) DEFAULT NULL COMMENT '微信二维码',
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='教练';

-- ----------------------------
-- Table structure for sv_device
-- ----------------------------
DROP TABLE IF EXISTS `sv_device`;
CREATE TABLE `sv_device` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL COMMENT '设备名称',
  `stream` varchar(70) NOT NULL COMMENT '视频流地址',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态：0未连接 1正在重连 2已连接',
  `venue_id` int(11) NOT NULL,
  `venue_type` tinyint(4) NOT NULL,
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `stream` (`stream`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for sv_faq
-- ----------------------------
DROP TABLE IF EXISTS `sv_faq`;
CREATE TABLE `sv_faq` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `problem` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '问题',
  `answer` longtext CHARACTER SET utf8mb4 NOT NULL COMMENT '答案',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='常见问题';

-- ----------------------------
-- Table structure for sv_gift_member_card
-- ----------------------------
DROP TABLE IF EXISTS `sv_gift_member_card`;
CREATE TABLE `sv_gift_member_card` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0赠送',
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `card_type` varchar(30) NOT NULL COMMENT '会员卡类型',
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=181 DEFAULT CHARSET=utf8mb4 COMMENT='赠送会员卡记录';

-- ----------------------------
-- Table structure for sv_member
-- ----------------------------
DROP TABLE IF EXISTS `sv_member`;
CREATE TABLE `sv_member` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `nickname` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '昵称',
  `avatar` varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图像',
  `status` tinyint(4) DEFAULT '0' COMMENT '状态： 0正常 1禁用',
  `invite_code` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '邀请码',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `mobile` varchar(11) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '手机号',
  `name` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '姓名',
  `sex` tinyint(3) DEFAULT '2' COMMENT '0男，1女，2未知',
  `age` int(4) DEFAULT NULL COMMENT '年龄',
  `address` varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '居住地',
  `money` decimal(20,2) DEFAULT '0.00' COMMENT '余额',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  `ban_type` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `mobile` (`mobile`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=420 DEFAULT CHARSET=utf8 COMMENT='用户基础表';

-- ----------------------------
-- Table structure for sv_member_auth
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_auth`;
CREATE TABLE `sv_member_auth` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `auth_id` varchar(100) DEFAULT NULL COMMENT '用户authID',
  `mobile` varchar(100) DEFAULT NULL COMMENT '手机号',
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '认证类型：1微信 2手机号',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `mobile` (`mobile`,`type`,`deleted`),
  KEY `auth_id` (`auth_id`,`type`,`deleted`),
  KEY `member_id` (`member_id`,`type`,`deleted`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=774 DEFAULT CHARSET=utf8 COMMENT='用户auth表';

-- ----------------------------
-- Table structure for sv_member_bank_card
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_bank_card`;
CREATE TABLE `sv_member_bank_card` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `bank_name` varchar(100) NOT NULL DEFAULT '1' COMMENT '开户行',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `bank_no` varchar(100) NOT NULL COMMENT '银行卡号',
  `name` varchar(30) DEFAULT NULL COMMENT '姓名',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COMMENT='用户银行卡';

-- ----------------------------
-- Table structure for sv_member_card
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_card`;
CREATE TABLE `sv_member_card` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `card_type` varchar(30) NOT NULL COMMENT '会员卡类型',
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '有效开始时间',
  `end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '有效结束时间',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '激活状态:0 未激活 1激活',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`,`end_time`,`status`,`deleted`,`venue_type`,`venue_id`) USING BTREE,
  KEY `member_id_2` (`venue_id`,`venue_type`,`start_time`,`end_time`,`member_id`) USING BTREE,
  KEY `venue_id` (`venue_id`,`venue_type`,`start_time`,`end_time`,`member_id`,`status`,`deleted`) USING BTREE,
  KEY `end_time` (`end_time`,`status`,`deleted`),
  KEY `start_time` (`start_time`,`status`,`deleted`,`member_id`)
) ENGINE=InnoDB AUTO_INCREMENT=191 DEFAULT CHARSET=utf8mb4 COMMENT='用户会员卡';

-- ----------------------------
-- Table structure for sv_member_card_order
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_card_order`;
CREATE TABLE `sv_member_card_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pay_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '支付状态：-1已取消 0未支付 1已支付',
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `card_type` varchar(30) NOT NULL COMMENT '会员卡类型',
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `order_sn` varchar(30) NOT NULL COMMENT '订单号',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `order_sn` (`order_sn`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COMMENT='用户会员卡订单';

-- ----------------------------
-- Table structure for sv_member_enter_veneu_log
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_enter_veneu_log`;
CREATE TABLE `sv_member_enter_veneu_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `veneu_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `order_sn` varchar(30) DEFAULT NULL COMMENT '入场支付订单',
  `member_card_id` int(11) DEFAULT NULL COMMENT '用户会员卡ID',
  `pay_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '入场支付方式：1支付 2会员卡',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  `type` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=793 DEFAULT CHARSET=utf8mb4 COMMENT='用户进场馆记录';

-- ----------------------------
-- Table structure for sv_member_face_info
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_face_info`;
CREATE TABLE `sv_member_face_info` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `face_url` varchar(200) NOT NULL COMMENT '用户人脸图片地址',
  `face_id` varchar(50) NOT NULL COMMENT '用户人脸识别ID',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT='用户人脸识别表';

-- ----------------------------
-- Table structure for sv_member_lesson_ticket
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_lesson_ticket`;
CREATE TABLE `sv_member_lesson_ticket` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `veneu_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `ticket_id` int(11) NOT NULL COMMENT '课程票号ID',
  `ticket` varchar(10) NOT NULL COMMENT '课程票号',
  `lesson_id` int(11) NOT NULL COMMENT '课程ID',
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `order_sn` varchar(30) DEFAULT NULL COMMENT '预约课程支付订单号',
  `pay_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '入场支付方式：1支付 2会员卡',
  `member_card_id` int(11) DEFAULT NULL COMMENT '用户会员卡ID',
  `pay_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '支付状态：-1已取消 0未支付 1已支付',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '使用状态:0未使用 1已使用 2已取消 3已过期未签到',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `order_sn` (`order_sn`),
  KEY `member_id` (`member_id`,`pay_status`,`status`,`deleted`),
  KEY `lesson_id` (`lesson_id`,`member_id`,`created_time`),
  KEY `member_id_2` (`member_id`,`lesson_id`,`pay_status`,`status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=1379 DEFAULT CHARSET=utf8mb4 COMMENT='用户预约的场馆课程票号';

-- ----------------------------
-- Table structure for sv_member_money_log
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_money_log`;
CREATE TABLE `sv_member_money_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型：1进场 2购买会员卡 3购买课程 4充值 5退款 6提现申请 7提现失败 8提现审核通过',
  `money` decimal(10,2) DEFAULT NULL COMMENT '金额',
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `pay_type` tinyint(4) NOT NULL COMMENT '1微信 2余额 3会员卡 ',
  `card_type` varchar(100) DEFAULT NULL COMMENT '会员卡类型',
  `venue_id` int(11) DEFAULT NULL COMMENT '场馆ID',
  `venue_type` tinyint(4) DEFAULT NULL COMMENT '场馆类型',
  `lesson_id` int(11) DEFAULT NULL COMMENT '课程ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `member_id` (`member_id`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=1288 DEFAULT CHARSET=utf8mb4 COMMENT='用户账单（余额，微信，会员卡）记录';

-- ----------------------------
-- Table structure for sv_member_refund
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_refund`;
CREATE TABLE `sv_member_refund` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `lesson_id` int(11) NOT NULL COMMENT '课程ID',
  `money` decimal(20,2) NOT NULL COMMENT '退款金额',
  `refund_status` varchar(100) DEFAULT NULL COMMENT 'SUCCESS-退款成功 CHANGE-退款异常 REFUNDCLOSE—退款关闭',
  `success_time` timestamp NULL DEFAULT NULL COMMENT '退款时间',
  `order_sn` varchar(100) NOT NULL COMMENT '商户订单号',
  `transaction_id` varchar(100) DEFAULT NULL COMMENT '微信订单号',
  `order_id` int(11) NOT NULL COMMENT '订单ID',
  `refund_id` varchar(100) DEFAULT NULL COMMENT '微信退款单号		',
  `out_refund_no` varchar(100) NOT NULL COMMENT '商户退款单号',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(4) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COMMENT='用户退款记录表';

-- ----------------------------
-- Table structure for sv_member_token
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_token`;
CREATE TABLE `sv_member_token` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `access_token` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `expire_time` datetime DEFAULT NULL,
  `member_id` int(11) DEFAULT NULL,
  `refresh_token` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(11) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(11) unsigned DEFAULT '0' COMMENT '更新者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=428 DEFAULT CHARSET=utf8mb4 COMMENT='用户token';

-- ----------------------------
-- Table structure for sv_member_withdraw_apply
-- ----------------------------
DROP TABLE IF EXISTS `sv_member_withdraw_apply`;
CREATE TABLE `sv_member_withdraw_apply` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `bank_name` varchar(100) NOT NULL DEFAULT '1' COMMENT '开户行',
  `bank_no` varchar(100) NOT NULL COMMENT '银行卡号',
  `name` varchar(30) DEFAULT NULL COMMENT '姓名',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态：-1已拒绝 0审核中 1已提现',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '提现金额',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='用户提现申请';

-- ----------------------------
-- Table structure for sv_order
-- ----------------------------
DROP TABLE IF EXISTS `sv_order`;
CREATE TABLE `sv_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pay_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '支付状态：-1已取消 0未支付 1已支付',
  `member_id` int(11) NOT NULL COMMENT '用户ID',
  `order_sn` varchar(30) NOT NULL COMMENT '订单号',
  `parent_order_id` int(11) DEFAULT NULL COMMENT '上级订单号',
  `trade_sn` varchar(100) DEFAULT NULL COMMENT '外部订单号',
  `pay_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '支付方式：1微信 2余额 3会员卡',
  `price` decimal(10,2) NOT NULL COMMENT '价格',
  `prepay_id` varchar(100) DEFAULT NULL,
  `pay_time` timestamp NULL DEFAULT NULL COMMENT '支付时间',
  `to_money` decimal(12,2) DEFAULT NULL COMMENT '余额充值到账金额',
  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型：1课程订单 2会员卡订单 3篮球进场 4余额充值',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `order_sn` (`order_sn`,`member_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1484 DEFAULT CHARSET=utf8mb4 COMMENT='订单';

-- ----------------------------
-- Table structure for sv_pay_config
-- ----------------------------
DROP TABLE IF EXISTS `sv_pay_config`;
CREATE TABLE `sv_pay_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `appId` varchar(100) NOT NULL COMMENT '微信appid',
  `key` varchar(100) NOT NULL COMMENT '支付key',
  `mchId` varchar(100) NOT NULL COMMENT '商户号',
  `notifyUrl` varchar(100) NOT NULL COMMENT '微信回调地址',
  `cancel` varchar(100) NOT NULL COMMENT '微信退款回调地址',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `deleted` tinyint(3) DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `cert` varchar(100) NOT NULL COMMENT '证书位置',
  `name` varchar(100) NOT NULL COMMENT '支付名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='支付参数配置表';

-- ----------------------------
-- Table structure for sv_platform
-- ----------------------------
DROP TABLE IF EXISTS `sv_platform`;
CREATE TABLE `sv_platform` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '平台来源',
  `key` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '平台key',
  `appId` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '小程序appId',
  `secret` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '小程序secret',
  `templateId` varchar(200) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '推送模板',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  `cache_key_access_token` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT 'cacheKeyAccessToken',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='平台信息表';

-- ----------------------------
-- Table structure for sv_protocol
-- ----------------------------
DROP TABLE IF EXISTS `sv_protocol`;
CREATE TABLE `sv_protocol` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `content` longtext NOT NULL COMMENT '内容',
  `platform_id` int(11) NOT NULL COMMENT '平台来源',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='协议';

-- ----------------------------
-- Table structure for sv_recharge
-- ----------------------------
DROP TABLE IF EXISTS `sv_recharge`;
CREATE TABLE `sv_recharge` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `recharge_money` decimal(7,2) NOT NULL COMMENT '充值金额',
  `to_money` decimal(7,2) NOT NULL COMMENT '到账金额',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='快速充值配置信息';

-- ----------------------------
-- Table structure for sv_sms
-- ----------------------------
DROP TABLE IF EXISTS `sv_sms`;
CREATE TABLE `sv_sms` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `platform` tinyint(3) unsigned NOT NULL COMMENT '平台: 1阿里云 2阿里大于 3云通讯 4云片 5蓝创 6聚合',
  `status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '状态：-1发送失败 0待发送 1发送成功 2已送达',
  `type` tinyint(3) unsigned NOT NULL COMMENT '类型：1验证类 2通知类',
  `mobile` char(11) NOT NULL COMMENT '手机号码',
  `content` varchar(512) NOT NULL DEFAULT '' COMMENT '短信内容',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` datetime NOT NULL COMMENT '创建时间',
  `modified_time` datetime NOT NULL COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位：0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `idx_deleted_status` (`deleted`,`status`),
  KEY `idx_type` (`type`),
  KEY `idx_platform` (`platform`),
  KEY `idx_mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=891 DEFAULT CHARSET=utf8mb4 COMMENT='短信记录';

-- ----------------------------
-- Table structure for sv_venue
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue`;
CREATE TABLE `sv_venue` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) CHARACTER SET utf8mb4 NOT NULL COMMENT '店名称',
  `address` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '地址',
  `longitude` varchar(40) NOT NULL COMMENT '经度',
  `latitude` varchar(40) NOT NULL COMMENT '纬度',
  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `list_image` varchar(200) CHARACTER SET utf8mb4 NOT NULL COMMENT '列表图片',
  `business_start_date` int(11) DEFAULT NULL COMMENT '开始营业星期几',
  `business_end_date` int(11) DEFAULT NULL COMMENT '结束营业星期几',
  `business_start_time` time DEFAULT NULL COMMENT '开始营业时间',
  `business_end_time` time DEFAULT NULL COMMENT '结束营业时间',
  `business_time` varchar(50) DEFAULT NULL COMMENT '营业时间: 周一至周日 8:00 ~ 9:00',
  `price` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '单次金额',
  `contact` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '联系人',
  `phone` varchar(11) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '联系人号码',
  `description` longtext CHARACTER SET utf8mb4 NOT NULL COMMENT '场馆介绍',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态：0正常 1禁用',
  `geo_hash` varchar(30) DEFAULT NULL COMMENT '坐标空间索引',
  `card_content` longtext COMMENT '会员卡说明',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  `code_url` varchar(255) DEFAULT NULL,
  `number` int(11) NOT NULL COMMENT '场馆人数',
  PRIMARY KEY (`id`),
  KEY `type` (`type`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8 COMMENT='场馆';

-- ----------------------------
-- Table structure for sv_venue_card
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_card`;
CREATE TABLE `sv_venue_card` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `card_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '会员卡类型',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态：0正常 1禁用',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `venue_id` (`venue_id`,`venue_type`,`status`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COMMENT='场馆会员卡';

-- ----------------------------
-- Table structure for sv_venue_image
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_image`;
CREATE TABLE `sv_venue_image` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `url` varchar(200) NOT NULL COMMENT '场馆图片',
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `venue_id` (`venue_id`,`venue_type`,`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8mb4 COMMENT='场馆图片';

-- ----------------------------
-- Table structure for sv_venue_lesson
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_lesson`;
CREATE TABLE `sv_venue_lesson` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `name` varchar(100) NOT NULL COMMENT '课程名称',
  `date` date NOT NULL COMMENT '上课日期 2018-03-30',
  `start_time` time NOT NULL COMMENT '课程开始时间 8:00',
  `end_time` time NOT NULL COMMENT '课程结束时间 12:00',
  `num` int(11) NOT NULL COMMENT '课程总数量',
  `sale_num` int(11) NOT NULL COMMENT '销售数量',
  `coach_id` int(11) NOT NULL COMMENT '教练ID',
  `qr_code` varchar(200) DEFAULT NULL COMMENT '二维码',
  `description` longtext COMMENT '课程描述',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '价格',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态：0草稿 1上架',
  `note` longtext COMMENT '注意事项',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0普通课程',
  PRIMARY KEY (`id`),
  KEY `date` (`date`,`venue_id`,`venue_type`,`status`,`deleted`),
  KEY `coach_id` (`coach_id`,`start_time`,`end_time`,`deleted`),
  KEY `venue_id` (`venue_id`,`venue_type`,`date`,`deleted`,`status`),
  KEY `venue_id_2` (`venue_id`,`venue_type`,`date`,`start_time`,`deleted`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=260 DEFAULT CHARSET=utf8mb4 COMMENT='场馆课程';

-- ----------------------------
-- Table structure for sv_venue_lesson_image
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_lesson_image`;
CREATE TABLE `sv_venue_lesson_image` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `lesson_id` int(11) NOT NULL COMMENT '课程ID',
  `url` varchar(200) NOT NULL COMMENT '课程图片',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1021 DEFAULT CHARSET=utf8mb4 COMMENT='场馆课程图片';

-- ----------------------------
-- Table structure for sv_venue_lesson_tag
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_lesson_tag`;
CREATE TABLE `sv_venue_lesson_tag` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL COMMENT '课程tag名称',
  `lesson_id` int(11) NOT NULL COMMENT '课程ID',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1657 DEFAULT CHARSET=utf8mb4 COMMENT='课程拥有的tag名称';

-- ----------------------------
-- Table structure for sv_venue_lesson_tag_config
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_lesson_tag_config`;
CREATE TABLE `sv_venue_lesson_tag_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL COMMENT '课程tag名称',
  `platform_id` int(11) NOT NULL DEFAULT '1',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COMMENT='课程tag名称列表';

-- ----------------------------
-- Table structure for sv_venue_lesson_ticket
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_lesson_ticket`;
CREATE TABLE `sv_venue_lesson_ticket` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `venue_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '场馆类型',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `ticket` varchar(10) NOT NULL COMMENT '课程票号',
  `lesson_id` int(11) NOT NULL COMMENT '课程ID',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态：0未购买 1已购买',
  `platform_id` int(11) NOT NULL COMMENT '平台来源ID',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket` (`ticket`,`lesson_id`) USING BTREE,
  KEY `lesson_id` (`lesson_id`,`deleted`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=2514 DEFAULT CHARSET=utf8mb4 COMMENT='场馆课程票号';

-- ----------------------------
-- Table structure for sv_venue_member
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_member`;
CREATE TABLE `sv_venue_member` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` int(11) DEFAULT NULL,
  `venue_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=211 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Table structure for sv_venue_price
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_price`;
CREATE TABLE `sv_venue_price` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `price` decimal(8,2) NOT NULL COMMENT '场馆价格',
  `venue_id` int(11) NOT NULL COMMENT '场馆ID',
  `venue_tye` tinyint(4) NOT NULL COMMENT '场馆类型',
  `star_time` time NOT NULL COMMENT '起始时间',
  `end_time` time NOT NULL COMMENT '结束时间',
  `platform_id` int(11) NOT NULL COMMENT '平台来源',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8mb4 COMMENT='场馆对应价格表';

-- ----------------------------
-- Table structure for sv_venue_type
-- ----------------------------
DROP TABLE IF EXISTS `sv_venue_type`;
CREATE TABLE `sv_venue_type` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL COMMENT '场馆名称',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:0 正常 1禁用',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `created_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) DEFAULT '0' COMMENT '创建者编号',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='场馆类型';

-- ----------------------------
-- Table structure for sv_vip_card
-- ----------------------------
DROP TABLE IF EXISTS `sv_vip_card`;
CREATE TABLE `sv_vip_card` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL COMMENT '会员卡名称',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态：0正常 1禁用',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='会员卡配置';

-- ----------------------------
-- Table structure for sys_admin
-- ----------------------------
DROP TABLE IF EXISTS `sys_admin`;
CREATE TABLE `sys_admin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态：0正常 1禁用',
  `mobile` char(11) DEFAULT '' COMMENT '手机号码',
  `password` varchar(64) NOT NULL COMMENT '密码',
  `salt` varchar(12) NOT NULL COMMENT '盐',
  `username` varchar(25) DEFAULT '' COMMENT '姓名',
  `gender` tinyint(3) unsigned DEFAULT '0' COMMENT '性别：0未知 1男 2女',
  `email` varchar(128) DEFAULT '' COMMENT '邮箱',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `idx_deleted_status` (`deleted`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 COMMENT='管理员';

-- ----------------------------
-- Table structure for sys_admin_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_admin_role`;
CREATE TABLE `sys_admin_role` (
  `admin_id` int(11) unsigned NOT NULL COMMENT '管理员编号',
  `role_id` int(11) unsigned NOT NULL COMMENT '角色编号',
  PRIMARY KEY (`admin_id`,`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色用户';

-- ----------------------------
-- Table structure for sys_config
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `name` varchar(32) NOT NULL COMMENT '名称',
  `key` varchar(64) NOT NULL COMMENT '键',
  `value` text NOT NULL COMMENT '值',
  `en_value` text,
  `created_id` int(11) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(11) unsigned DEFAULT '0' COMMENT '更新者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_deleted_key` (`deleted`,`key`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='全局参数';

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态：0正常 1禁用',
  `name` varchar(32) NOT NULL COMMENT '菜单名称',
  `en_name` varchar(50) DEFAULT NULL,
  `url` varchar(128) NOT NULL COMMENT '地址',
  `icon` varchar(128) NOT NULL COMMENT '菜单图标',
  `parent_id` int(11) unsigned DEFAULT '0' COMMENT '上级菜单编号',
  `sort` int(11) unsigned DEFAULT '0' COMMENT '排序',
  `remark` varchar(512) DEFAULT '' COMMENT '备注说明',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `idx_deleted_status` (`deleted`,`status`),
  KEY `idx_sort` (`sort`),
  KEY `idx_parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 COMMENT='菜单';

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `name` varchar(25) NOT NULL COMMENT '权限点名称',
  `key` varchar(45) NOT NULL COMMENT '权限点',
  `menu_id` int(11) unsigned NOT NULL COMMENT '菜单编号',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `idx_deleted` (`deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COMMENT='权限点';

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
  `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态：0正常 1禁用',
  `name` varchar(32) NOT NULL COMMENT '角色名称',
  `created_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `modified_id` int(10) unsigned DEFAULT '0' COMMENT '创建者编号',
  `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `modified_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint(3) unsigned DEFAULT '0' COMMENT '删除标识位: 0正常 1删除',
  PRIMARY KEY (`id`),
  KEY `idx_deleted_status` (`deleted`,`status`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COMMENT='角色';

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `role_id` int(11) unsigned NOT NULL COMMENT '角色编号',
  `menu_id` int(11) unsigned NOT NULL COMMENT '菜单编号',
  PRIMARY KEY (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色菜单';

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `role_id` int(11) unsigned NOT NULL COMMENT '角色编号',
  `permission_id` int(11) unsigned NOT NULL COMMENT '权限点编号',
  PRIMARY KEY (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色权限点';

SET FOREIGN_KEY_CHECKS = 1;
