diff --git a/SQL01-数据表结构.sql b/SQL01-数据表结构.sql index 37cb19f03..de7826805 100644 --- a/SQL01-数据表结构.sql +++ b/SQL01-数据表结构.sql @@ -1,6 +1,22 @@ +/* + Navicat MySQL Data Transfer + + Source Server : anyon.localhost + Source Server Type : MySQL + Source Server Version : 80018 + Source Host : localhost:3306 + Source Schema : admin_v6 + + Target Server Type : MySQL + Target Server Version : 80018 + File Encoding : 65001 + + Date: 29/07/2021 14:09:36 +*/ + SET NAMES utf8mb4; SET - FOREIGN_KEY_CHECKS = 0; +FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for base_postage_company @@ -8,26 +24,23 @@ SET DROP TABLE IF EXISTS `base_postage_company`; CREATE TABLE `base_postage_company` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司名称', - `code_1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司代码', - `code_2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '百度快递100代码', - `code_3` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '官方快递100代码', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司名称', + `code_1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司代码', + `code_2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '百度快递100代码', + `code_3` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '官方快递100代码', `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司描述', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0.无效,1.有效)', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态(1已删除,0未删除)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0.无效,1.有效)', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态(1已删除,0未删除)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_base_postage_company_code1` (`code_1`) USING BTREE, - INDEX `idx_base_postage_company_code2` (`code_2`) USING BTREE, - INDEX `idx_base_postage_company_code3` (`code_3`) USING BTREE, - INDEX `idx_base_postage_company_status` (`status`) USING BTREE, - INDEX `idx_base_postage_company_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 31 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-公司'; + INDEX `idx_base_postage_company_code1`(`code_1`) USING BTREE, + INDEX `idx_base_postage_company_code2`(`code_2`) USING BTREE, + INDEX `idx_base_postage_company_code3`(`code_3`) USING BTREE, + INDEX `idx_base_postage_company_status`(`status`) USING BTREE, + INDEX `idx_base_postage_company_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-公司' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for base_postage_region @@ -35,24 +48,21 @@ CREATE TABLE `base_postage_company` DROP TABLE IF EXISTS `base_postage_region`; CREATE TABLE `base_postage_region` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', - `pid` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '上级PID', - `first` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '首字母', + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', + `pid` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '上级PID', + `first` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '首字母', `short` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域简称', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域名称', + `level` tinyint(4) NULL DEFAULT 0 COMMENT '区域层级', + `pinyin` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域拼音', + `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域邮编', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '使用状态', `lng` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在经度', `lat` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在纬度', - `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域邮编', - `level` tinyint(4) NULL DEFAULT 0 COMMENT '区域层级', - `pinyin` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '区域拼音', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '使用状态', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_base_postage_region_pid` (`pid`) USING BTREE, - INDEX `idx_base_postage_region_name` (`name`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 4019 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-区域'; + INDEX `idx_base_postage_region_pid`(`pid`) USING BTREE, + INDEX `idx_base_postage_region_name`(`name`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-区域' ROW_FORMAT = COMPACT; -- ---------------------------- -- Table structure for base_postage_template @@ -60,23 +70,20 @@ CREATE TABLE `base_postage_region` DROP TABLE IF EXISTS `base_postage_template`; CREATE TABLE `base_postage_template` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '模板编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '模板编号', `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '模板名称', - `normal` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '默认规则', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '模板规则', - `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '模板状态', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `normal` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '默认规则', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '模板规则', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '模板状态', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_base_postage_template_code` (`code`) USING BTREE, - INDEX `idx_base_postage_template_status` (`status`) USING BTREE, - INDEX `idx_base_postage_template_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-模板'; + INDEX `idx_base_postage_template_code`(`code`) USING BTREE, + INDEX `idx_base_postage_template_status`(`status`) USING BTREE, + INDEX `idx_base_postage_template_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-快递-模板' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for base_user_discount @@ -84,21 +91,18 @@ CREATE TABLE `base_postage_template` DROP TABLE IF EXISTS `base_user_discount`; CREATE TABLE `base_user_discount` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '方案名称', - `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '方案规则', + `items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '方案规则', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '方案描述', - `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '方案状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '方案状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_base_user_discount_status` (`status`) USING BTREE, - INDEX `idx_base_user_discount_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 2 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-折扣'; + INDEX `idx_base_user_discount_status`(`status`) USING BTREE, + INDEX `idx_base_user_discount_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-折扣' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for base_user_message @@ -106,23 +110,20 @@ CREATE TABLE `base_user_discount` DROP TABLE IF EXISTS `base_user_message`; CREATE TABLE `base_user_message` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息类型', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息类型', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息名称', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '消息内容', - `num_read` bigint(20) NULL DEFAULT 0 COMMENT '阅读次数', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '消息状态(1使用,0禁用)', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '消息内容', + `num_read` bigint(20) NULL DEFAULT 0 COMMENT '阅读次数', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '消息状态(1使用,0禁用)', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_base_user_message_type` (`type`) USING BTREE, - INDEX `idx_base_user_message_status` (`status`) USING BTREE, - INDEX `idx_base_user_message_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 3 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-通知'; + INDEX `idx_base_user_message_type`(`type`) USING BTREE, + INDEX `idx_base_user_message_status`(`status`) USING BTREE, + INDEX `idx_base_user_message_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-通知' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for base_user_payment @@ -130,26 +131,23 @@ CREATE TABLE `base_user_message` DROP TABLE IF EXISTS `base_user_payment`; CREATE TABLE `base_user_payment` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付类型', - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '通道编号', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付类型', + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '通道编号', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付名称', `cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付图标', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '支付参数', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '支付参数', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付说明', - `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '支付状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '支付状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_base_user_payment_type` (`type`) USING BTREE, - INDEX `idx_base_user_payment_code` (`code`) USING BTREE, - INDEX `idx_base_user_payment_status` (`status`) USING BTREE, - INDEX `idx_base_user_payment_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 7 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-支付'; + INDEX `idx_base_user_payment_type`(`type`) USING BTREE, + INDEX `idx_base_user_payment_code`(`code`) USING BTREE, + INDEX `idx_base_user_payment_status`(`status`) USING BTREE, + INDEX `idx_base_user_payment_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-基础-支付' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for base_user_upgrade @@ -157,32 +155,29 @@ CREATE TABLE `base_user_payment` DROP TABLE IF EXISTS `base_user_upgrade`; CREATE TABLE `base_user_upgrade` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, + `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户级别名称', - `number` tinyint(2) NULL DEFAULT 0 COMMENT '用户级别序号', + `number` tinyint(2) NULL DEFAULT 0 COMMENT '用户级别序号', `rebate_rule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户奖利规则', - `upgrade_type` tinyint(1) NULL DEFAULT 0 COMMENT '会员升级规则(0单个,1同时)', - `upgrade_team` tinyint(1) NULL DEFAULT 1 COMMENT '团队人数统计(0不计,1累计)', - `goods_vip_status` tinyint(1) NULL DEFAULT 0 COMMENT '入会礼包状态', - `order_amount_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单金额状态', - `order_amount_number` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额累计', - `teams_users_status` tinyint(1) NULL DEFAULT 0 COMMENT '团队人数状态', - `teams_users_number` bigint(20) NULL DEFAULT 0 COMMENT '团队人数累计', - `teams_direct_status` tinyint(1) NULL DEFAULT 0 COMMENT '直推人数状态', - `teams_direct_number` bigint(20) NULL DEFAULT 0 COMMENT '直推人数累计', - `teams_indirect_status` tinyint(1) NULL DEFAULT 0 COMMENT '间推人数状态', - `teams_indirect_number` bigint(20) NULL DEFAULT 0 COMMENT '间推人数累计', + `upgrade_type` tinyint(1) NULL DEFAULT 0 COMMENT '会员升级规则(0单个,1同时)', + `upgrade_team` tinyint(1) NULL DEFAULT 1 COMMENT '团队人数统计(0不计,1累计)', + `goods_vip_status` tinyint(1) NULL DEFAULT 0 COMMENT '入会礼包状态', + `order_amount_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单金额状态', + `order_amount_number` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额累计', + `teams_users_status` tinyint(1) NULL DEFAULT 0 COMMENT '团队人数状态', + `teams_users_number` bigint(20) NULL DEFAULT 0 COMMENT '团队人数累计', + `teams_direct_status` tinyint(1) NULL DEFAULT 0 COMMENT '直推人数状态', + `teams_direct_number` bigint(20) NULL DEFAULT 0 COMMENT '直推人数累计', + `teams_indirect_status` tinyint(1) NULL DEFAULT 0 COMMENT '间推人数状态', + `teams_indirect_number` bigint(20) NULL DEFAULT 0 COMMENT '间推人数累计', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户级别描述', - `utime` bigint(20) NULL DEFAULT 0 COMMENT '等级更新时间', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '用户等级状态(1使用,0禁用)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '等级创建时间', + `utime` bigint(20) NULL DEFAULT 0 COMMENT '等级更新时间', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '用户等级状态(1使用,0禁用)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '等级创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_base_user_upgrade_status` (`status`) USING BTREE, - INDEX `idx_base_user_upgrade_number` (`number`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 6 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-等级'; + INDEX `idx_base_user_upgrade_status`(`status`) USING BTREE, + INDEX `idx_base_user_upgrade_number`(`number`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-等级' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_news_item @@ -190,29 +185,26 @@ CREATE TABLE `base_user_upgrade` DROP TABLE IF EXISTS `data_news_item`; CREATE TABLE `data_news_item` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章编号', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章标题', `mark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章标签', `cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章封面', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注说明', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文章内容', - `num_like` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章点赞数', - `num_read` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章阅读数', - `num_collect` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章收藏数', - `num_comment` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章评论数', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '文章状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文章内容', + `num_like` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章点赞数', + `num_read` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章阅读数', + `num_collect` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章收藏数', + `num_comment` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '文章评论数', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '文章状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_news_item_code` (`code`) USING BTREE, - INDEX `idx_data_news_item_status` (`status`) USING BTREE, - INDEX `idx_data_news_item_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-内容'; + INDEX `idx_data_news_item_code`(`code`) USING BTREE, + INDEX `idx_data_news_item_status`(`status`) USING BTREE, + INDEX `idx_data_news_item_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-内容' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_news_mark @@ -220,20 +212,17 @@ CREATE TABLE `data_news_item` DROP TABLE IF EXISTS `data_news_mark`; CREATE TABLE `data_news_mark` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签名称', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签说明', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '标签状态(1使用,0禁用)', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '标签状态(1使用,0禁用)', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_news_mark_status` (`status`) USING BTREE, - INDEX `idx_data_news_mark_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标签'; + INDEX `idx_data_news_mark_status`(`status`) USING BTREE, + INDEX `idx_data_news_mark_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标签' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_news_x_collect @@ -241,22 +230,19 @@ CREATE TABLE `data_news_mark` DROP TABLE IF EXISTS `data_news_x_collect`; CREATE TABLE `data_news_x_collect` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', - `type` tinyint(1) NULL DEFAULT 1 COMMENT '记录类型(1收藏,2点赞,3历史,4评论)', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', + `type` tinyint(1) NULL DEFAULT 1 COMMENT '记录类型(1收藏,2点赞,3历史,4评论)', `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章编号', - `reply` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '评论内容', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '记录状态(0无效,1待审核,2已审核)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `reply` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '评论内容', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '记录状态(0无效,1待审核,2已审核)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_news_x_collect_uuid` (`uuid`) USING BTREE, - INDEX `idx_data_news_x_collect_type` (`type`) USING BTREE, - INDEX `idx_data_news_x_collect_code` (`code`) USING BTREE, - INDEX `idx_data_news_x_collect_status` (`status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标记'; + INDEX `idx_data_news_x_collect_uuid`(`uuid`) USING BTREE, + INDEX `idx_data_news_x_collect_type`(`type`) USING BTREE, + INDEX `idx_data_news_x_collect_code`(`code`) USING BTREE, + INDEX `idx_data_news_x_collect_status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-文章-标记' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user @@ -264,65 +250,62 @@ CREATE TABLE `data_news_x_collect` DROP TABLE IF EXISTS `data_user`; CREATE TABLE `data_user` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `pid0` bigint(20) NULL DEFAULT 0 COMMENT '临时推荐人UID', - `pid1` bigint(20) NULL DEFAULT 0 COMMENT '推荐人一级UID', - `pid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐人二级UID', - `pids` tinyint(1) NULL DEFAULT 0 COMMENT '推荐人绑定状态', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `pid0` bigint(20) NULL DEFAULT 0 COMMENT '临时推荐人UID', + `pid1` bigint(20) NULL DEFAULT 0 COMMENT '推荐人一级UID', + `pid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐人二级UID', + `pids` tinyint(1) NULL DEFAULT 0 COMMENT '推荐人绑定状态', `path` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '-' COMMENT '推荐关系路径', - `layer` bigint(20) NULL DEFAULT 1 COMMENT '推荐关系层级', - `openid1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '小程序OPENID', - `openid2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '服务号OPENID', - `unionid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号UnionID', - `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户手机', + `layer` bigint(20) NULL DEFAULT 1 COMMENT '推荐关系层级', + `openid1` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '小程序OPENID', + `openid2` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '服务号OPENID', + `unionid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号UnionID', + `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户手机', `headimg` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户头像', - `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户姓名', - `nickname` varchar(99) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户昵称', - `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '登录密码', - `region_province` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在省份', - `region_city` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在城市', - `region_area` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在区域', - `base_age` bigint(20) NULL DEFAULT 0 COMMENT '用户年龄', - `base_sex` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户性别', - `base_height` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户身高', - `base_weight` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户体重', - `base_birthday` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户生日', - `vip_code` bigint(20) NULL DEFAULT 0 COMMENT 'VIP等级编号', - `vip_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '普通用户' COMMENT 'VIP等级名称', - `vip_order` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'VIP升级订单', - `vip_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'VIP等级时间', - `buy_vip_entry` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否入会礼包', - `buy_last_date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '最后支付时间', - `rebate_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '返利金额统计', - `rebate_used` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '返利提现统计', - `rebate_lock` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '返利锁定统计', - `balance_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '累计充值统计', - `balance_used` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '已经使用统计', - `teams_users_total` bigint(20) NULL DEFAULT 0 COMMENT '团队人数统计', - `teams_users_direct` bigint(20) NULL DEFAULT 0 COMMENT '直属人数团队', - `teams_users_indirect` bigint(20) NULL DEFAULT 0 COMMENT '间接人数团队', - `order_amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单交易统计', - `teams_amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '二级团队业绩', - `teams_amount_direct` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '直属团队业绩', - `teams_amount_indirect` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '间接团队业绩', + `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户姓名', + `nickname` varchar(99) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户昵称', + `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '登录密码', + `region_province` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在省份', + `region_city` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在城市', + `region_area` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '所在区域', + `base_age` bigint(20) NULL DEFAULT 0 COMMENT '用户年龄', + `base_sex` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户性别', + `base_height` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户身高', + `base_weight` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户体重', + `base_birthday` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户生日', + `vip_code` bigint(20) NULL DEFAULT 0 COMMENT 'VIP等级编号', + `vip_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '普通用户' COMMENT 'VIP等级名称', + `vip_order` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'VIP升级订单', + `vip_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT 'VIP等级时间', + `buy_vip_entry` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否入会礼包', + `buy_last_date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '最后支付时间', + `rebate_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '返利金额统计', + `rebate_used` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '返利提现统计', + `rebate_lock` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '返利锁定统计', + `balance_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '累计充值统计', + `balance_used` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '已经使用统计', + `teams_users_total` bigint(20) NULL DEFAULT 0 COMMENT '团队人数统计', + `teams_users_direct` bigint(20) NULL DEFAULT 0 COMMENT '直属人数团队', + `teams_users_indirect` bigint(20) NULL DEFAULT 0 COMMENT '间接人数团队', + `order_amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单交易统计', + `teams_amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '二级团队业绩', + `teams_amount_direct` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '直属团队业绩', + `teams_amount_indirect` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '间接团队业绩', `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户备注描述', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '用户状态(1正常,0已黑)', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '用户状态(1正常,0已黑)', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_pid0` (`pid0`) USING BTREE, - INDEX `idx_data_user_pid1` (`pid1`) USING BTREE, - INDEX `idx_data_user_pid2` (`pid2`) USING BTREE, - INDEX `idx_data_user_pids` (`pids`) USING BTREE, - INDEX `idx_data_user_status` (`status`) USING BTREE, - INDEX `idx_data_user_deleted` (`deleted`) USING BTREE, - INDEX `idx_data_user_openid1` (`openid1`) USING BTREE, - INDEX `idx_data_user_openid2` (`openid2`) USING BTREE, - INDEX `idx_data_user_unionid` (`unionid`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 2 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-会员'; + INDEX `idx_data_user_pid0`(`pid0`) USING BTREE, + INDEX `idx_data_user_pid1`(`pid1`) USING BTREE, + INDEX `idx_data_user_pid2`(`pid2`) USING BTREE, + INDEX `idx_data_user_pids`(`pids`) USING BTREE, + INDEX `idx_data_user_status`(`status`) USING BTREE, + INDEX `idx_data_user_deleted`(`deleted`) USING BTREE, + INDEX `idx_data_user_openid1`(`openid1`) USING BTREE, + INDEX `idx_data_user_openid2`(`openid2`) USING BTREE, + INDEX `idx_data_user_unionid`(`unionid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-会员' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user_address @@ -330,12 +313,12 @@ CREATE TABLE `data_user` DROP TABLE IF EXISTS `data_user_address`; CREATE TABLE `data_user_address` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID', - `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '地址类型(0普通,1默认)', - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID', + `type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '地址类型(0普通,1默认)', + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址编号', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '收货姓名', - `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '收货手机', + `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '收货手机', `idcode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '身体证号', `idimg1` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '身份证正面', `idimg2` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '身份证反面', @@ -343,17 +326,14 @@ CREATE TABLE `data_user_address` `city` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址-城市', `area` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址-区域', `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址-详情', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_address_uuid` (`uuid`) USING BTREE, - INDEX `idx_data_user_address_type` (`type`) USING BTREE, - INDEX `idx_data_user_address_code` (`code`) USING BTREE, - INDEX `idx_data_user_address_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-地址'; + INDEX `idx_data_user_address_uuid`(`uuid`) USING BTREE, + INDEX `idx_data_user_address_type`(`type`) USING BTREE, + INDEX `idx_data_user_address_code`(`code`) USING BTREE, + INDEX `idx_data_user_address_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-地址' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user_balance @@ -361,24 +341,21 @@ CREATE TABLE `data_user_address` DROP TABLE IF EXISTS `data_user_balance`; CREATE TABLE `data_user_balance` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID', - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '用户UID', + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值编号', `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值名称', `remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '充值备注', - `amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '充值金额', - `upgrade` tinyint(20) NULL DEFAULT 0 COMMENT '强制升级', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', - `create_by` bigint(20) NULL DEFAULT 0 COMMENT '系统用户', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '充值金额', + `upgrade` tinyint(20) NULL DEFAULT 0 COMMENT '强制升级', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', + `create_by` bigint(20) NULL DEFAULT 0 COMMENT '系统用户', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_balance_uuid` (`uuid`) USING BTREE, - INDEX `idx_data_user_balance_code` (`code`) USING BTREE, - INDEX `idx_data_user_balance_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-余额'; + INDEX `idx_data_user_balance_uuid`(`uuid`) USING BTREE, + INDEX `idx_data_user_balance_code`(`code`) USING BTREE, + INDEX `idx_data_user_balance_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-余额' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user_message @@ -386,24 +363,21 @@ CREATE TABLE `data_user_balance` DROP TABLE IF EXISTS `data_user_message`; CREATE TABLE `data_user_message` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '短信类型', - `msgid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '短信类型', + `msgid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号', `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '目标手机', `region` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '国家编号', `result` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '返回结果', `content` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '短信内容', - `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '短信状态(0失败,1成功)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '短信状态(0失败,1成功)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_message_type` (`type`) USING BTREE, - INDEX `idx_data_user_message_phone` (`phone`) USING BTREE, - INDEX `idx_data_user_message_msgid` (`msgid`) USING BTREE, - INDEX `idx_data_user_message_status` (`status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-短信'; + INDEX `idx_data_user_message_type`(`type`) USING BTREE, + INDEX `idx_data_user_message_phone`(`phone`) USING BTREE, + INDEX `idx_data_user_message_msgid`(`msgid`) USING BTREE, + INDEX `idx_data_user_message_status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-短信' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user_payment @@ -411,27 +385,24 @@ CREATE TABLE `data_user_message` DROP TABLE IF EXISTS `data_user_payment`; CREATE TABLE `data_user_payment` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号', `order_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单描述', - `order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额', - `payment_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付编号', - `payment_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付通道', + `order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额', + `payment_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付编号', + `payment_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付通道', `payment_trade` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付单号', - `payment_status` tinyint(1) NULL DEFAULT 0 COMMENT '支付状态', - `payment_amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '支付金额', - `payment_datatime` datetime NULL DEFAULT NULL COMMENT '支付时间', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `payment_status` tinyint(1) NULL DEFAULT 0 COMMENT '支付状态', + `payment_amount` decimal(20, 2) NULL DEFAULT NULL COMMENT '支付金额', + `payment_datatime` datetime NULL DEFAULT NULL COMMENT '支付时间', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_payment_order_no` (`order_no`) USING BTREE, - INDEX `idx_data_user_payment_payment_code` (`payment_code`) USING BTREE, - INDEX `idx_data_user_payment_payment_type` (`payment_type`) USING BTREE, - INDEX `idx_data_user_payment_payment_trade` (`payment_trade`) USING BTREE, - INDEX `idx_data_user_payment_payment_status` (`payment_status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-支付'; + INDEX `idx_data_user_payment_order_no`(`order_no`) USING BTREE, + INDEX `idx_data_user_payment_payment_code`(`payment_code`) USING BTREE, + INDEX `idx_data_user_payment_payment_type`(`payment_type`) USING BTREE, + INDEX `idx_data_user_payment_payment_trade`(`payment_trade`) USING BTREE, + INDEX `idx_data_user_payment_payment_status`(`payment_status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-支付' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user_rebate @@ -439,30 +410,27 @@ CREATE TABLE `data_user_payment` DROP TABLE IF EXISTS `data_user_rebate`; CREATE TABLE `data_user_rebate` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', - `date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励日期', - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励编号', - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励类型', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', + `date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励日期', + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励编号', + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励类型', `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '奖励名称', - `amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励数量', - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号', - `order_uuid` bigint(20) NULL DEFAULT 0 COMMENT '订单用户', - `order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '生效状态(0未生效,1已生效)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删除,1已删除)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励数量', + `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单单号', + `order_uuid` bigint(20) NULL DEFAULT 0 COMMENT '订单用户', + `order_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单金额', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '生效状态(0未生效,1已生效)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删除,1已删除)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_rebate_uuid` (`uuid`) USING BTREE, - INDEX `idx_data_user_rebate_type` (`type`) USING BTREE, - INDEX `idx_data_user_rebate_date` (`date`) USING BTREE, - INDEX `idx_data_user_rebate_code` (`code`) USING BTREE, - INDEX `idx_data_user_rebate_name` (`name`) USING BTREE, - INDEX `idx_data_user_rebate_status` (`status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-返利'; + INDEX `idx_data_user_rebate_uuid`(`uuid`) USING BTREE, + INDEX `idx_data_user_rebate_type`(`type`) USING BTREE, + INDEX `idx_data_user_rebate_date`(`date`) USING BTREE, + INDEX `idx_data_user_rebate_code`(`code`) USING BTREE, + INDEX `idx_data_user_rebate_name`(`name`) USING BTREE, + INDEX `idx_data_user_rebate_status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-返利' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user_token @@ -470,21 +438,18 @@ CREATE TABLE `data_user_rebate` DROP TABLE IF EXISTS `data_user_token`; CREATE TABLE `data_user_token` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权类型', - `time` bigint(20) NULL DEFAULT 0 COMMENT '有效时间', + `time` bigint(20) NULL DEFAULT 0 COMMENT '有效时间', `token` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权令牌', `tokenv` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '授权验证', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_token_type` (`type`) USING BTREE, - INDEX `idx_data_user_token_time` (`time`) USING BTREE, - INDEX `idx_data_user_token_token` (`token`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-认证'; + INDEX `idx_data_user_token_type`(`type`) USING BTREE, + INDEX `idx_data_user_token_time`(`time`) USING BTREE, + INDEX `idx_data_user_token_token`(`token`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-认证' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for data_user_transfer @@ -492,18 +457,18 @@ CREATE TABLE `data_user_token` DROP TABLE IF EXISTS `data_user_transfer`; CREATE TABLE `data_user_transfer` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', - `type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现方式', - `date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现日期', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) NULL DEFAULT 0 COMMENT '用户UID', + `type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现方式', + `date` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现日期', `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现单号', `appid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', `openid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号OPENID', - `charge_rate` decimal(20, 4) NULL DEFAULT 0.0000 COMMENT '提现手续费比例', - `charge_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '提现手续费金额', - `amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '提现转账金额', + `charge_rate` decimal(20, 4) NULL DEFAULT 0.0000 COMMENT '提现手续费比例', + `charge_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '提现手续费金额', + `amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '提现转账金额', `qrcode` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '收款码图片地址', - `bank_wseq` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '微信银行编号', + `bank_wseq` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '微信银行编号', `bank_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '开户银行名称', `bank_bran` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '开户分行名称', `bank_user` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '开户账号姓名', @@ -512,27 +477,24 @@ CREATE TABLE `data_user_transfer` `alipay_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付宝账号', `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '提现描述', `trade_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '交易单号', - `trade_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '打款时间', - `change_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '处理时间', + `trade_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '打款时间', + `change_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '处理时间', `change_desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '处理描述', - `audit_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '审核状态', + `audit_status` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '审核状态', `audit_remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '审核描述', - `audit_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '审核时间', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `audit_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '审核时间', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_data_user_transfer_uuid` (`uuid`) USING BTREE, - INDEX `idx_data_user_transfer_date` (`date`) USING BTREE, - INDEX `idx_data_user_transfer_type` (`type`) USING BTREE, - INDEX `idx_data_user_transfer_code` (`code`) USING BTREE, - INDEX `idx_data_user_transfer_status` (`status`) USING BTREE, - INDEX `idx_data_user_transfer_appid` (`appid`) USING BTREE, - INDEX `idx_data_user_transfer_openid` (`openid`) USING BTREE, - INDEX `idx_data_user_transfer_audit_status` (`audit_status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-提现'; + INDEX `idx_data_user_transfer_uuid`(`uuid`) USING BTREE, + INDEX `idx_data_user_transfer_date`(`date`) USING BTREE, + INDEX `idx_data_user_transfer_type`(`type`) USING BTREE, + INDEX `idx_data_user_transfer_code`(`code`) USING BTREE, + INDEX `idx_data_user_transfer_status`(`status`) USING BTREE, + INDEX `idx_data_user_transfer_appid`(`appid`) USING BTREE, + INDEX `idx_data_user_transfer_openid`(`openid`) USING BTREE, + INDEX `idx_data_user_transfer_audit_status`(`audit_status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '数据-用户-提现' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_goods @@ -540,46 +502,43 @@ CREATE TABLE `data_user_transfer` DROP TABLE IF EXISTS `shop_goods`; CREATE TABLE `shop_goods` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', `name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品名称', `marks` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品标签', `cateids` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '分类编号', `cover` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品封面', - `slider` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '轮播图片', + `slider` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '轮播图片', `remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品描述', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品详情', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品详情', `payment` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付方式', - `data_specs` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品规格(JSON)', - `data_items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品规格(JSON)', - `stock_total` bigint(20) NULL DEFAULT 0 COMMENT '商品库存统计', - `stock_sales` bigint(20) NULL DEFAULT 0 COMMENT '商品销售统计', - `stock_virtual` bigint(20) NULL DEFAULT 0 COMMENT '商品虚拟销量', - `price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '最低销售价格', - `price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '最低市场价格', - `discount_id` bigint(20) NULL DEFAULT 0 COMMENT '折扣方案编号', - `truck_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '物流运费模板', - `truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送(0无需配送,1需要配送)', - `rebate_type` tinyint(1) NULL DEFAULT 1 COMMENT '参与返利(0无需返利,1需要返利)', - `vip_entry` tinyint(1) NULL DEFAULT 0 COMMENT '入会礼包(0非入会礼包,1是入会礼包)', - `vip_upgrade` bigint(20) NULL DEFAULT 0 COMMENT '购买升级等级(0不升级,其他升级)', - `limit_low_vip` bigint(20) NULL DEFAULT 0 COMMENT '限制最低等级(0不限制,其他限制)', - `limit_max_num` bigint(20) NULL DEFAULT 0 COMMENT '最大购买数量(0不限制,其他限制)', - `num_read` bigint(20) NULL DEFAULT 0 COMMENT '访问阅读统计', - `state_hot` tinyint(1) NULL DEFAULT 0 COMMENT '设置热度标签', - `state_home` tinyint(1) NULL DEFAULT 0 COMMENT '设置首页推荐', - `sort` bigint(20) NULL DEFAULT 0 COMMENT '列表排序权重', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `data_specs` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品规格(JSON)', + `data_items` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品规格(JSON)', + `stock_total` bigint(20) NULL DEFAULT 0 COMMENT '商品库存统计', + `stock_sales` bigint(20) NULL DEFAULT 0 COMMENT '商品销售统计', + `stock_virtual` bigint(20) NULL DEFAULT 0 COMMENT '商品虚拟销量', + `price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '最低销售价格', + `price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '最低市场价格', + `discount_id` bigint(20) NULL DEFAULT 0 COMMENT '折扣方案编号', + `truck_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '物流运费模板', + `truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送(0无需配送,1需要配送)', + `rebate_type` tinyint(1) NULL DEFAULT 1 COMMENT '参与返利(0无需返利,1需要返利)', + `vip_entry` tinyint(1) NULL DEFAULT 0 COMMENT '入会礼包(0非入会礼包,1是入会礼包)', + `vip_upgrade` bigint(20) NULL DEFAULT 0 COMMENT '购买升级等级(0不升级,其他升级)', + `limit_low_vip` bigint(20) NULL DEFAULT 0 COMMENT '限制最低等级(0不限制,其他限制)', + `limit_max_num` bigint(20) NULL DEFAULT 0 COMMENT '最大购买数量(0不限制,其他限制)', + `num_read` bigint(20) NULL DEFAULT 0 COMMENT '访问阅读统计', + `state_hot` tinyint(1) NULL DEFAULT 0 COMMENT '设置热度标签', + `state_home` tinyint(1) NULL DEFAULT 0 COMMENT '设置首页推荐', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '列表排序权重', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_goods_code` (`code`) USING BTREE, - INDEX `idx_shop_goods_status` (`status`) USING BTREE, - INDEX `idx_shop_goods_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-内容'; + INDEX `idx_shop_goods_code`(`code`) USING BTREE, + INDEX `idx_shop_goods_status`(`status`) USING BTREE, + INDEX `idx_shop_goods_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-内容' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_goods_cate @@ -587,23 +546,20 @@ CREATE TABLE `shop_goods` DROP TABLE IF EXISTS `shop_goods_cate`; CREATE TABLE `shop_goods_cate` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `pid` bigint(20) NULL DEFAULT 0 COMMENT '上级分类', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `pid` bigint(20) NULL DEFAULT 0 COMMENT '上级分类', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '分类名称', `cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '分类图标', `remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '分类描述', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '使用状态', - `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '使用状态', + `deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_goods_cate_sort` (`sort`) USING BTREE, - INDEX `idx_shop_goods_cate_status` (`status`) USING BTREE, - INDEX `idx_shop_goods_cate_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-分类'; + INDEX `idx_shop_goods_cate_sort`(`sort`) USING BTREE, + INDEX `idx_shop_goods_cate_status`(`status`) USING BTREE, + INDEX `idx_shop_goods_cate_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-分类' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_goods_item @@ -611,28 +567,25 @@ CREATE TABLE `shop_goods_cate` DROP TABLE IF EXISTS `shop_goods_item`; CREATE TABLE `shop_goods_item` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品SKU', - `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品SKU', + `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', `goods_spec` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品规格', - `stock_sales` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '销售数量', - `stock_total` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '商品库存', - `price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '销售价格', - `price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '市场价格', - `number_virtual` bigint(20) NULL DEFAULT 0 COMMENT '虚拟销量', - `number_express` bigint(20) NULL DEFAULT 1 COMMENT '配送计件', - `reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励余额', - `reward_integral` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励积分', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '商品状态', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `stock_sales` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '销售数量', + `stock_total` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '商品库存', + `price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '销售价格', + `price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '市场价格', + `number_virtual` bigint(20) NULL DEFAULT 0 COMMENT '虚拟销量', + `number_express` bigint(20) NULL DEFAULT 1 COMMENT '配送计件', + `reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励余额', + `reward_integral` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励积分', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '商品状态', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `index_store_goods_item_code` (`goods_code`) USING BTREE, - INDEX `index_store_goods_item_spec` (`goods_spec`) USING BTREE, - INDEX `index_store_goods_item_status` (`status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-规格'; + INDEX `index_store_goods_item_code`(`goods_code`) USING BTREE, + INDEX `index_store_goods_item_spec`(`goods_spec`) USING BTREE, + INDEX `index_store_goods_item_status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-规格' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_goods_mark @@ -640,19 +593,16 @@ CREATE TABLE `shop_goods_item` DROP TABLE IF EXISTS `shop_goods_mark`; CREATE TABLE `shop_goods_mark` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签名称', `remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '标签描述', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '标签状态(1使用,0禁用)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '标签状态(1使用,0禁用)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_goods_mark_sort` (`sort`) USING BTREE, - INDEX `idx_shop_goods_mark_status` (`status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-标签'; + INDEX `idx_shop_goods_mark_sort`(`sort`) USING BTREE, + INDEX `idx_shop_goods_mark_status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-标签' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_goods_stock @@ -660,21 +610,18 @@ CREATE TABLE `shop_goods_mark` DROP TABLE IF EXISTS `shop_goods_stock`; CREATE TABLE `shop_goods_stock` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `batch_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '操作批量', - `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `batch_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '操作批量', + `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品编号', `goods_spec` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品规格', - `goods_stock` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '入库数量', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '数据状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `goods_stock` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '入库数量', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '数据状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_goods_stock_status` (`status`) USING BTREE, - INDEX `idx_shop_goods_stock_deleted` (`deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-库存'; + INDEX `idx_shop_goods_stock_status`(`status`) USING BTREE, + INDEX `idx_shop_goods_stock_deleted`(`deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-商品-库存' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_order @@ -682,53 +629,50 @@ CREATE TABLE `shop_goods_stock` DROP TABLE IF EXISTS `shop_order`; CREATE TABLE `shop_order` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '下单用户编号', - `puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐一层用户', - `puid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐二层用户', - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品订单单号', - `amount_real` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单实际金额', - `amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单统计金额', - `amount_goods` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品统计金额', - `amount_reduct` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '随机减免金额', - `amount_express` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '快递费用金额', - `amount_discount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '折扣后的金额', - `payment_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '实际支付平台', - `payment_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '实际通道编号', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '下单用户编号', + `puid1` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '推荐一层用户', + `puid2` bigint(20) NULL DEFAULT 0 COMMENT '推荐二层用户', + `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品订单单号', + `amount_real` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单实际金额', + `amount_total` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '订单统计金额', + `amount_goods` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品统计金额', + `amount_reduct` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '随机减免金额', + `amount_express` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '快递费用金额', + `amount_discount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '折扣后的金额', + `payment_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '实际支付平台', + `payment_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '实际通道编号', `payment_allow` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '允许支付通道', - `payment_trade` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '实际支付单号', - `payment_status` tinyint(1) NULL DEFAULT 0 COMMENT '实际支付状态', + `payment_trade` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '实际支付单号', + `payment_status` tinyint(1) NULL DEFAULT 0 COMMENT '实际支付状态', `payment_image` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付凭证图片', - `payment_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '实际支付金额', - `payment_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '余额抵扣金额', + `payment_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '实际支付金额', + `payment_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '余额抵扣金额', `payment_remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付结果描述', - `payment_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付到账时间', - `number_goods` bigint(20) NULL DEFAULT 0 COMMENT '订单商品数量', - `number_express` bigint(20) NULL DEFAULT 0 COMMENT '订单快递计数', - `truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送类型(0无需配送,1需要配送)', - `rebate_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '参与返利金额', - `reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励账户余额', + `payment_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '支付到账时间', + `number_goods` bigint(20) NULL DEFAULT 0 COMMENT '订单商品数量', + `number_express` bigint(20) NULL DEFAULT 0 COMMENT '订单快递计数', + `truck_type` tinyint(1) NULL DEFAULT 0 COMMENT '物流配送类型(0无需配送,1需要配送)', + `rebate_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '参与返利金额', + `reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '奖励账户余额', `order_remark` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单用户备注', - `cancel_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单取消状态', + `cancel_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单取消状态', `cancel_remark` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单取消描述', - `cancel_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单取消时间', - `deleted_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单删除状态(0未删,1已删)', + `cancel_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单取消时间', + `deleted_status` tinyint(1) NULL DEFAULT 0 COMMENT '订单删除状态(0未删,1已删)', `deleted_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单删除描述', - `deleted_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单删除时间', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间', + `deleted_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '订单删除时间', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_order_mid` (`uuid`) USING BTREE, - INDEX `idx_shop_order_from` (`puid1`) USING BTREE, - INDEX `idx_shop_order_status` (`status`) USING BTREE, - INDEX `idx_shop_order_deleted` (`deleted_status`) USING BTREE, - INDEX `idx_shop_order_orderno` (`order_no`) USING BTREE, - INDEX `idx_shop_order_cancel_status` (`cancel_status`) USING BTREE, - INDEX `idx_shop_order_payment_status` (`payment_status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-内容'; + INDEX `idx_shop_order_mid`(`uuid`) USING BTREE, + INDEX `idx_shop_order_from`(`puid1`) USING BTREE, + INDEX `idx_shop_order_status`(`status`) USING BTREE, + INDEX `idx_shop_order_deleted`(`deleted_status`) USING BTREE, + INDEX `idx_shop_order_orderno`(`order_no`) USING BTREE, + INDEX `idx_shop_order_cancel_status`(`cancel_status`) USING BTREE, + INDEX `idx_shop_order_payment_status`(`payment_status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-内容' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_order_item @@ -736,49 +680,46 @@ CREATE TABLE `shop_order` DROP TABLE IF EXISTS `shop_order_item`; CREATE TABLE `shop_order_item` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号', - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号', - `goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品SKU', - `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品编号', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号', + `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号', + `goods_sku` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品SKU', + `goods_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品编号', `goods_spec` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品规格', `goods_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城商品名称', `goods_cover` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商品封面图片', `goods_payment` varchar(999) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '指定支付通道', - `price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品市场单价', - `price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品销售单价', - `total_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品市场总价', - `total_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品销售总价', - `reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品奖励余额', - `reward_integral` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品奖励积分', - `stock_sales` bigint(20) NULL DEFAULT 1 COMMENT '包含商品数量', - `vip_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户等级名称', - `vip_code` bigint(20) NULL DEFAULT 0 COMMENT '用户等级序号', - `vip_entry` tinyint(1) NULL DEFAULT 0 COMMENT '是否入会礼包(0非礼包,1是礼包)', - `vip_upgrade` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '升级用户等级', - `truck_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '物流配送类型(0虚物,1实物)', - `truck_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递邮费模板', - `truck_number` bigint(20) NULL DEFAULT 0 COMMENT '快递计费基数', - `rebate_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '参与返利状态(0不返,1返利)', - `rebate_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '参与返利金额', - `discount_id` bigint(20) NULL DEFAULT 0 COMMENT '优惠方案编号', - `discount_rate` decimal(20, 6) NULL DEFAULT 100.000000 COMMENT '销售价格折扣', - `discount_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品优惠金额', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间', + `price_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品市场单价', + `price_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品销售单价', + `total_market` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品市场总价', + `total_selling` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品销售总价', + `reward_balance` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品奖励余额', + `reward_integral` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品奖励积分', + `stock_sales` bigint(20) NULL DEFAULT 1 COMMENT '包含商品数量', + `vip_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户等级名称', + `vip_code` bigint(20) NULL DEFAULT 0 COMMENT '用户等级序号', + `vip_entry` tinyint(1) NULL DEFAULT 0 COMMENT '是否入会礼包(0非礼包,1是礼包)', + `vip_upgrade` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '升级用户等级', + `truck_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '物流配送类型(0虚物,1实物)', + `truck_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递邮费模板', + `truck_number` bigint(20) NULL DEFAULT 0 COMMENT '快递计费基数', + `rebate_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '参与返利状态(0不返,1返利)', + `rebate_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '参与返利金额', + `discount_id` bigint(20) NULL DEFAULT 0 COMMENT '优惠方案编号', + `discount_rate` decimal(20, 6) NULL DEFAULT 100.000000 COMMENT '销售价格折扣', + `discount_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '商品优惠金额', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '商品状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0未删,1已删)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_order_item_status` (`status`) USING BTREE, - INDEX `idx_shop_order_item_deleted` (`deleted`) USING BTREE, - INDEX `idx_shop_order_item_order_no` (`order_no`) USING BTREE, - INDEX `idx_shop_order_item_goods_sku` (`goods_sku`) USING BTREE, - INDEX `idx_shop_order_item_goods_code` (`goods_code`) USING BTREE, - INDEX `idx_shop_order_item_goods_spec` (`goods_spec`) USING BTREE, - INDEX `idx_shop_order_item_rebate_type` (`rebate_type`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-商品'; + INDEX `idx_shop_order_item_status`(`status`) USING BTREE, + INDEX `idx_shop_order_item_deleted`(`deleted`) USING BTREE, + INDEX `idx_shop_order_item_order_no`(`order_no`) USING BTREE, + INDEX `idx_shop_order_item_goods_sku`(`goods_sku`) USING BTREE, + INDEX `idx_shop_order_item_goods_code`(`goods_code`) USING BTREE, + INDEX `idx_shop_order_item_goods_spec`(`goods_spec`) USING BTREE, + INDEX `idx_shop_order_item_rebate_type`(`rebate_type`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-商品' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for shop_order_send @@ -786,41 +727,38 @@ CREATE TABLE `shop_order_item` DROP TABLE IF EXISTS `shop_order_send`; CREATE TABLE `shop_order_send` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `uuid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号', - `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号', - `address_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址编号', - `address_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人姓名', - `address_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人手机', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `uuid` bigint(20) NULL DEFAULT 0 COMMENT '商城用户编号', + `order_no` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '商城订单单号', + `address_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址编号', + `address_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人姓名', + `address_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人手机', `address_idcode` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人证件号码', `address_idimg1` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人证件正面', `address_idimg2` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送收货人证件反面', - `address_province` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址的省份', - `address_city` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址的城市', - `address_area` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址的区域', + `address_province` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址的省份', + `address_city` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址的城市', + `address_area` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送地址的区域', `address_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送的详细地址', - `address_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址确认时间', - `template_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送模板编号', - `template_count` bigint(20) NULL DEFAULT 0 COMMENT '快递计费基数', + `address_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '地址确认时间', + `template_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送模板编号', + `template_count` bigint(20) NULL DEFAULT 0 COMMENT '快递计费基数', `template_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配送计算描述', - `template_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '配送计算金额', - `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司编码', + `template_amount` decimal(20, 2) NULL DEFAULT 0.00 COMMENT '配送计算金额', + `company_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司编码', `company_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递公司名称', `send_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递运送单号', `send_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递发送备注', - `send_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递发送时间', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '发货商品状态(1使用,0禁用)', - `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '发货删除状态(0未删,1已删)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `send_datetime` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '快递发送时间', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '发货商品状态(1使用,0禁用)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '发货删除状态(0未删,1已删)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_shop_order_send_mid` (`uuid`) USING BTREE, - INDEX `idx_shop_order_send_status` (`status`) USING BTREE, - INDEX `idx_shop_order_send_deleted` (`deleted`) USING BTREE, - INDEX `idx_shop_order_send_order_no` (`order_no`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-配送'; + INDEX `idx_shop_order_send_mid`(`uuid`) USING BTREE, + INDEX `idx_shop_order_send_status`(`status`) USING BTREE, + INDEX `idx_shop_order_send_deleted`(`deleted`) USING BTREE, + INDEX `idx_shop_order_send_order_no`(`order_no`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商城-订单-配送' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for system_auth @@ -828,19 +766,17 @@ CREATE TABLE `shop_order_send` DROP TABLE IF EXISTS `system_auth`; CREATE TABLE `system_auth` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '权限名称', + `utype` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '身份权限', `desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注说明', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '权限状态(1使用,0禁用)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '权限状态(1使用,0禁用)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_system_auth_title` (`title`) USING BTREE, - INDEX `idx_system_auth_status` (`status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-权限'; + INDEX `idx_system_auth_title`(`title`) USING BTREE, + INDEX `idx_system_auth_status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-权限' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for system_auth_node @@ -848,16 +784,36 @@ CREATE TABLE `system_auth` DROP TABLE IF EXISTS `system_auth_node`; CREATE TABLE `system_auth_node` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `auth` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '角色', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `auth` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '角色', `node` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '节点', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_system_auth_auth` (`auth`) USING BTREE, - INDEX `idx_system_auth_node` (`node`(191)) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-授权'; + INDEX `idx_system_auth_auth`(`auth`) USING BTREE, + INDEX `idx_system_auth_node`(`node`(191)) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-授权' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Table structure for system_base +-- ---------------------------- +DROP TABLE IF EXISTS `system_base`; +CREATE TABLE `system_base` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '数据类型', + `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '数据代码', + `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '数据名称', + `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '数据内容', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '数据状态(0禁用,1启动)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0正常,1已删)', + `deleted_at` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '删除时间', + `deleted_by` bigint(20) NULL DEFAULT 0 COMMENT '删除用户', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_system_base_type`(`type`) USING BTREE, + INDEX `idx_system_base_code`(`code`) USING BTREE, + INDEX `idx_system_base_name`(`name`(191)) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-字典' ROW_FORMAT = COMPACT; -- ---------------------------- -- Table structure for system_config @@ -865,17 +821,14 @@ CREATE TABLE `system_auth_node` DROP TABLE IF EXISTS `system_config`; CREATE TABLE `system_config` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置分类', - `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置名称', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置分类', + `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置名称', `value` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置内容', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_system_config_type` (`type`) USING BTREE, - INDEX `idx_system_config_name` (`name`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-配置'; + INDEX `idx_system_config_type`(`type`) USING BTREE, + INDEX `idx_system_config_name`(`name`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-配置' ROW_FORMAT = COMPACT; -- ---------------------------- -- Table structure for system_data @@ -883,15 +836,12 @@ CREATE TABLE `system_config` DROP TABLE IF EXISTS `system_data`; CREATE TABLE `system_data` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '配置名', - `value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '配置值', + `value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '配置值', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_system_data_name` (`name`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-数据'; + INDEX `idx_system_data_name`(`name`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-数据' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for system_menu @@ -899,23 +849,20 @@ CREATE TABLE `system_data` DROP TABLE IF EXISTS `system_menu`; CREATE TABLE `system_menu` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `pid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '上级ID', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `pid` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '上级ID', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '菜单名称', `icon` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '菜单图标', `node` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '节点代码', `url` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '链接节点', `params` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '链接参数', - `target` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '_self' COMMENT '打开方式', - `sort` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0:禁用,1:启用)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `target` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '_self' COMMENT '打开方式', + `sort` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0:禁用,1:启用)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_system_menu_status` (`status`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-菜单'; + INDEX `idx_system_menu_status`(`status`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-菜单' ROW_FORMAT = COMPACT; -- ---------------------------- -- Table structure for system_oplog @@ -923,7 +870,7 @@ CREATE TABLE `system_menu` DROP TABLE IF EXISTS `system_oplog`; CREATE TABLE `system_oplog` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `node` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '当前操作节点', `geoip` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '操作者IP地址', `action` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '操作行为名称', @@ -931,10 +878,7 @@ CREATE TABLE `system_oplog` `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '操作人用户名', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-日志'; +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-日志' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for system_queue @@ -942,32 +886,29 @@ CREATE TABLE `system_oplog` DROP TABLE IF EXISTS `system_queue`; CREATE TABLE `system_queue` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, + `id` bigint(20) NOT NULL AUTO_INCREMENT, `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务编号', `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务名称', - `command` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '执行指令', - `exec_pid` bigint(20) NULL DEFAULT 0 COMMENT '执行进程', - `exec_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '执行参数', - `exec_time` bigint(20) NULL DEFAULT 0 COMMENT '执行时间', - `exec_desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '执行描述', - `enter_time` decimal(20, 4) NULL DEFAULT 0.0000 COMMENT '开始时间', - `outer_time` decimal(20, 4) NULL DEFAULT 0.0000 COMMENT '结束时间', - `loops_time` bigint(20) NULL DEFAULT 0 COMMENT '循环时间', - `attempts` bigint(20) NULL DEFAULT 0 COMMENT '执行次数', - `rscript` tinyint(1) NULL DEFAULT 1 COMMENT '任务类型(0单例,1多例)', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '任务状态(1新任务,2处理中,3成功,4失败)', + `command` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '执行指令', + `exec_pid` bigint(20) NULL DEFAULT 0 COMMENT '执行进程', + `exec_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '执行参数', + `exec_time` bigint(20) NULL DEFAULT 0 COMMENT '执行时间', + `exec_desc` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '执行描述', + `enter_time` decimal(20, 4) NULL DEFAULT 0.0000 COMMENT '开始时间', + `outer_time` decimal(20, 4) NULL DEFAULT 0.0000 COMMENT '结束时间', + `loops_time` bigint(20) NULL DEFAULT 0 COMMENT '循环时间', + `attempts` bigint(20) NULL DEFAULT 0 COMMENT '执行次数', + `rscript` tinyint(1) NULL DEFAULT 1 COMMENT '任务类型(0单例,1多例)', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '任务状态(1新任务,2处理中,3成功,4失败)', `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_system_queue_code` (`code`) USING BTREE, - INDEX `idx_system_queue_title` (`title`) USING BTREE, - INDEX `idx_system_queue_status` (`status`) USING BTREE, - INDEX `idx_system_queue_rscript` (`rscript`) USING BTREE, - INDEX `idx_system_queue_create_at` (`create_at`) USING BTREE, - INDEX `idx_system_queue_exec_time` (`exec_time`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-任务'; + INDEX `idx_system_queue_code`(`code`) USING BTREE, + INDEX `idx_system_queue_title`(`title`) USING BTREE, + INDEX `idx_system_queue_status`(`status`) USING BTREE, + INDEX `idx_system_queue_rscript`(`rscript`) USING BTREE, + INDEX `idx_system_queue_create_at`(`create_at`) USING BTREE, + INDEX `idx_system_queue_exec_time`(`exec_time`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-任务' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for system_user @@ -975,31 +916,28 @@ CREATE TABLE `system_queue` DROP TABLE IF EXISTS `system_user`; CREATE TABLE `system_user` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户账号', - `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户密码', - `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户昵称', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户账号', + `password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户密码', + `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户昵称', `headimg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '头像地址', `authorize` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '权限授权', - `contact_qq` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '联系QQ', - `contact_mail` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '联系邮箱', - `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '联系手机', + `contact_qq` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '联系QQ', + `contact_mail` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '联系邮箱', + `contact_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '联系手机', `login_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '登录地址', - `login_at` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '登录时间', - `login_num` bigint(20) NULL DEFAULT 0 COMMENT '登录次数', + `login_at` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '登录时间', + `login_num` bigint(20) NULL DEFAULT 0 COMMENT '登录次数', `describe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注说明', - `status` tinyint(1) NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', - `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', - `is_deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除(1删除,0未删)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', + `is_deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除(1删除,0未删)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_system_user_status` (`status`) USING BTREE, - INDEX `idx_system_user_username` (`username`) USING BTREE, - INDEX `idx_system_user_deleted` (`is_deleted`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 10001 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '系统-用户'; + INDEX `idx_system_user_status`(`status`) USING BTREE, + INDEX `idx_system_user_username`(`username`) USING BTREE, + INDEX `idx_system_user_deleted`(`is_deleted`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-用户' ROW_FORMAT = COMPACT; -- ---------------------------- -- Table structure for wechat_auto @@ -1007,12 +945,12 @@ CREATE TABLE `system_user` DROP TABLE IF EXISTS `wechat_auto`; CREATE TABLE `wechat_auto` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', `time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '延迟时间', - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号', - `appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', - `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文本内容', + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号', + `appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', + `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文本内容', `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '图片链接', `voice_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '语音链接', `music_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐标题', @@ -1022,19 +960,16 @@ CREATE TABLE `wechat_auto` `video_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频标题', `video_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频URL', `video_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频描述', - `news_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '图文ID', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', - `create_by` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '创建人', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', + `news_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '图文ID', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', + `create_by` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '创建人', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_wechat_auto_type` (`type`) USING BTREE, - INDEX `idx_wechat_auto_keys` (`time`) USING BTREE, - INDEX `idx_wechat_auto_code` (`code`) USING BTREE, - INDEX `idx_wechat_auto_appid` (`appid`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '微信-回复'; + INDEX `idx_wechat_auto_type`(`type`) USING BTREE, + INDEX `idx_wechat_auto_keys`(`time`) USING BTREE, + INDEX `idx_wechat_auto_code`(`code`) USING BTREE, + INDEX `idx_wechat_auto_appid`(`appid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-回复' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for wechat_fans @@ -1042,36 +977,33 @@ CREATE TABLE `wechat_auto` DROP TABLE IF EXISTS `wechat_fans`; CREATE TABLE `wechat_fans` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `appid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `appid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', `unionid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '粉丝unionid', `openid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '粉丝openid', `tagid_list` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '粉丝标签id', - `is_black` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否为黑名单状态', - `subscribe` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '关注状态(0未关注,1已关注)', + `is_black` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否为黑名单状态', + `subscribe` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '关注状态(0未关注,1已关注)', `nickname` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户昵称', - `sex` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '用户性别(1男性,2女性,0未知)', - `country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户所在国家', - `province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户所在省份', - `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户所在城市', - `language` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户的语言(zh_CN)', + `sex` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '用户性别(1男性,2女性,0未知)', + `country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户所在国家', + `province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户所在省份', + `city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户所在城市', + `language` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户的语言(zh_CN)', `headimgurl` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '用户头像', - `subscribe_time` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '关注时间', - `subscribe_at` datetime NULL DEFAULT NULL COMMENT '关注时间', - `remark` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注', + `subscribe_time` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '关注时间', + `subscribe_at` datetime NULL DEFAULT NULL COMMENT '关注时间', + `remark` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注', `subscribe_scene` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '扫码关注场景', `qr_scene` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '二维码场景值', `qr_scene_str` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '二维码场景内容', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `index_wechat_fans_openid` (`openid`) USING BTREE, - INDEX `index_wechat_fans_unionid` (`unionid`) USING BTREE, - INDEX `index_wechat_fans_isblack` (`is_black`) USING BTREE, - INDEX `index_wechat_fans_subscribe` (`subscribe`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '微信-粉丝'; + INDEX `index_wechat_fans_openid`(`openid`) USING BTREE, + INDEX `index_wechat_fans_unionid`(`unionid`) USING BTREE, + INDEX `index_wechat_fans_isblack`(`is_black`) USING BTREE, + INDEX `index_wechat_fans_subscribe`(`subscribe`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-粉丝' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for wechat_fans_tags @@ -1079,17 +1011,14 @@ CREATE TABLE `wechat_fans` DROP TABLE IF EXISTS `wechat_fans_tags`; CREATE TABLE `wechat_fans_tags` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '标签ID', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '标签ID', `appid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', `name` varchar(35) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '标签名称', - `count` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '总数', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期', - INDEX `index_wechat_fans_tags_id` (`id`) USING BTREE, - INDEX `index_wechat_fans_tags_appid` (`appid`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '微信-标签'; + `count` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '总数', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期', + INDEX `index_wechat_fans_tags_id`(`id`) USING BTREE, + INDEX `index_wechat_fans_tags_appid`(`appid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-标签' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for wechat_keys @@ -1097,11 +1026,11 @@ CREATE TABLE `wechat_fans_tags` DROP TABLE IF EXISTS `wechat_keys`; CREATE TABLE `wechat_keys` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', `keys` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '关键字', - `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文本内容', + `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文本内容', `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '图片链接', `voice_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '语音链接', `music_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐标题', @@ -1111,19 +1040,16 @@ CREATE TABLE `wechat_keys` `video_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频标题', `video_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频URL', `video_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频描述', - `news_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '图文ID', - `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序字段', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', - `create_by` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '创建人', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', + `news_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '图文ID', + `sort` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '排序字段', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', + `create_by` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '创建人', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `index_wechat_keys_type` (`type`) USING BTREE, - INDEX `index_wechat_keys_keys` (`keys`) USING BTREE, - INDEX `index_wechat_keys_appid` (`appid`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 2 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '微信-规则'; + INDEX `index_wechat_keys_type`(`type`) USING BTREE, + INDEX `index_wechat_keys_keys`(`keys`) USING BTREE, + INDEX `index_wechat_keys_appid`(`appid`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-规则' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for wechat_media @@ -1131,23 +1057,20 @@ CREATE TABLE `wechat_keys` DROP TABLE IF EXISTS `wechat_media`; CREATE TABLE `wechat_media` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文件md5', - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '媒体类型', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `md5` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文件md5', + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '媒体类型', `appid` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号ID', `media_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材MediaID', `local_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '本地文件链接', `media_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '远程图片链接', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, - INDEX `index_wechat_media_md5` (`md5`) USING BTREE, - INDEX `index_wechat_media_type` (`type`) USING BTREE, - INDEX `index_wechat_media_appid` (`appid`) USING BTREE, - INDEX `index_wechat_media_media_id` (`media_id`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '微信-素材'; + INDEX `index_wechat_media_md5`(`md5`) USING BTREE, + INDEX `index_wechat_media_type`(`type`) USING BTREE, + INDEX `index_wechat_media_appid`(`appid`) USING BTREE, + INDEX `index_wechat_media_media_id`(`media_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-素材' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for wechat_news @@ -1155,20 +1078,17 @@ CREATE TABLE `wechat_media` DROP TABLE IF EXISTS `wechat_news`; CREATE TABLE `wechat_news` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, `media_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材MediaID', `local_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材外网URL', - `article_id` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '关联图文ID(用英文逗号做分割)', - `is_deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态(0未删除,1已删除)', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', - `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', + `article_id` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '关联图文ID(用英文逗号做分割)', + `is_deleted` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态(0未删除,1已删除)', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建人', PRIMARY KEY (`id`) USING BTREE, - INDEX `index_wechat_news_media_id` (`media_id`) USING BTREE, - INDEX `index_wechat_news_artcle_id` (`article_id`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '微信-图文'; + INDEX `index_wechat_news_media_id`(`media_id`) USING BTREE, + INDEX `index_wechat_news_artcle_id`(`article_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-图文' ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for wechat_news_article @@ -1176,21 +1096,18 @@ CREATE TABLE `wechat_news` DROP TABLE IF EXISTS `wechat_news_article`; CREATE TABLE `wechat_news_article` ( - `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '素材标题', + `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '素材标题', `local_url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '永久素材显示URL', - `show_cover_pic` tinyint(4) UNSIGNED NULL DEFAULT 0 COMMENT '显示封面(0不显示,1显示)', - `author` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章作者', + `show_cover_pic` tinyint(4) UNSIGNED NULL DEFAULT 0 COMMENT '显示封面(0不显示,1显示)', + `author` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '文章作者', `digest` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '摘要内容', - `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '图文内容', + `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '图文内容', `content_source_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '原文地址', - `read_num` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '阅读数量', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `read_num` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '阅读数量', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - CHARACTER SET = utf8mb4 - COLLATE = utf8mb4_unicode_ci COMMENT = '微信-文章'; +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-文章' ROW_FORMAT = Dynamic; SET - FOREIGN_KEY_CHECKS = 1; +FOREIGN_KEY_CHECKS = 1; diff --git a/SQL02-数据初始化.sql b/SQL02-数据初始化.sql index 500026498..b40bfcb0d 100644 --- a/SQL02-数据初始化.sql +++ b/SQL02-数据初始化.sql @@ -7561,7 +7561,7 @@ VALUES (4, 'base', 'miitbeian', ''); INSERT INTO `system_config` VALUES (5, 'base', 'site_copy', '©版权所有 2014-2020 楚才科技'); INSERT INTO `system_config` -VALUES (6, 'base', 'site_icon', 'http://127.0.0.1/upload/f4/7b8fe06e38ae9908e8398da45583b9.png'); +VALUES (6, 'base', 'site_icon', 'https://v6.thinkadmin.top/upload/f4/7b8fe06e38ae9908e8398da45583b9.png'); INSERT INTO `system_config` VALUES (7, 'base', 'site_name', 'ThinkAdmin'); INSERT INTO `system_config` @@ -7608,7 +7608,7 @@ CREATE TABLE `system_menu` `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY (`id`) USING BTREE, INDEX `idx_system_menu_status`(`status`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 99 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-菜单' ROW_FORMAT = COMPACT; +) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统-菜单' ROW_FORMAT = COMPACT; -- ---------------------------- -- Records of system_menu @@ -7624,13 +7624,15 @@ VALUES (5, 12, '系统用户管理', 'layui-icon layui-icon-username', '', 'admi INSERT INTO `system_menu` VALUES (7, 12, '访问权限管理', 'layui-icon layui-icon-vercode', '', 'admin/auth/index', '', '_self', 2, 1, '2018-09-06 15:17:14'); INSERT INTO `system_menu` -VALUES (11, 4, '系统参数配置', 'layui-icon layui-icon-set', '', 'admin/config/index', '', '_self', 4, 1, '2018-09-06 16:43:47'); +VALUES (8, 4, '数据字典管理', 'layui-icon layui-icon-code-circle', 'admin/base/index', 'admin/base/index', '', '_self', 2, 1, '2021-07-29 14:17:42'); +INSERT INTO `system_menu` +VALUES (11, 4, '系统参数配置', 'layui-icon layui-icon-set', '', 'admin/config/index', '', '_self', 5, 1, '2018-09-06 16:43:47'); INSERT INTO `system_menu` VALUES (12, 2, '权限管理', '', '', '#', '', '_self', 10, 1, '2018-09-06 18:01:31'); INSERT INTO `system_menu` -VALUES (27, 4, '系统任务管理', 'layui-icon layui-icon-log', '', 'admin/queue/index', '', '_self', 3, 1, '2018-11-29 11:13:34'); +VALUES (27, 4, '系统任务管理', 'layui-icon layui-icon-log', '', 'admin/queue/index', '', '_self', 4, 1, '2018-11-29 11:13:34'); INSERT INTO `system_menu` -VALUES (49, 4, '系统日志管理', 'layui-icon layui-icon-form', '', 'admin/oplog/index', '', '_self', 2, 1, '2019-02-18 12:56:56'); +VALUES (49, 4, '系统日志管理', 'layui-icon layui-icon-form', '', 'admin/oplog/index', '', '_self', 3, 1, '2019-02-18 12:56:56'); INSERT INTO `system_menu` VALUES (56, 0, '微信管理', '', '', '#', '', '_self', 200, 1, '2019-12-09 11:00:37'); INSERT INTO `system_menu` @@ -7703,7 +7705,6 @@ INSERT INTO `system_menu` VALUES (98, 0, '首 页', '', 'data/total.portal/index', 'data/total.portal/index', '', '_self', 400, 1, '2021-04-10 13:43:19'); INSERT INTO `system_menu` VALUES (99, 60, '关注自动回复', 'layui-icon layui-icon-release', 'wechat/auto/index', 'wechat/auto/index', '', '_self', 0, 1, '2021-04-10 15:56:54'); - -- ---------------------------- -- Table structure for system_user -- ---------------------------- diff --git a/SQL03-数据库升级.sql b/SQL03-数据库升级.sql index 9c50b778b..157aebc52 100644 --- a/SQL03-数据库升级.sql +++ b/SQL03-数据库升级.sql @@ -1,52 +1,69 @@ -/* - Navicat MySQL Data Transfer - - Source Server : anyon.localhost - Source Server Type : MySQL - Source Server Version : 80018 - Source Host : localhost:3306 - Source Schema : admin_v6 - - Target Server Type : MySQL - Target Server Version : 80018 - File Encoding : 65001 - - Date: 12/04/2021 10:39:27 -*/ - SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; --- ---------------------------- --- Table structure for wechat_auto --- ---------------------------- -CREATE TABLE IF NOT EXISTS `wechat_auto` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', - `time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '延迟时间', - `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号', - `appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', - `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文本内容', - `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '图片链接', - `voice_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '语音链接', - `music_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐标题', - `music_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐链接', - `music_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '缩略图片', - `music_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐描述', - `video_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频标题', - `video_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频URL', - `video_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频描述', - `news_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '图文ID', - `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', - `create_by` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '创建人', - `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', - PRIMARY KEY (`id`) USING BTREE, - INDEX `idx_wechat_auto_type`(`type`) USING BTREE, - INDEX `idx_wechat_auto_keys`(`time`) USING BTREE, - INDEX `idx_wechat_auto_appid`(`appid`) USING BTREE, - INDEX `idx_wechat_auto_code`(`code`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '微信-回复' ROW_FORMAT = COMPACT; +-- 尝试创建微信自动回复数据表 +CREATE TABLE IF NOT EXISTS `wechat_auto` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '类型(text,image,news)', + `time` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '延迟时间', + `code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '消息编号', + `appid` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '公众号APPID', + `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '文本内容', + `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '图片链接', + `voice_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '语音链接', + `music_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐标题', + `music_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐链接', + `music_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '缩略图片', + `music_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '音乐描述', + `video_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频标题', + `video_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频URL', + `video_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '视频描述', + `news_id` bigint(20) UNSIGNED NULL DEFAULT NULL COMMENT '图文ID', + `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态(0禁用,1启用)', + `create_by` bigint(20) UNSIGNED NULL DEFAULT 0 COMMENT '创建人', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_wechat_auto_type` (`type`) USING BTREE, + INDEX `idx_wechat_auto_keys` (`time`) USING BTREE, + INDEX `idx_wechat_auto_appid` (`appid`) USING BTREE, + INDEX `idx_wechat_auto_code` (`code`) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 1 + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_unicode_ci COMMENT = '微信-回复' + ROW_FORMAT = COMPACT; -ALTER TABLE `system_queue` MODIFY COLUMN `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务名称' AFTER `code`; +-- 调整字段名称长度 +ALTER TABLE `system_queue` + MODIFY COLUMN `title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '任务名称' AFTER `code`; -SET FOREIGN_KEY_CHECKS = 1; +-- 尝试创建数据字典数据表 +CREATE TABLE IF NOT EXISTS `system_base` +( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '数据类型', + `code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '数据代码', + `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '数据名称', + `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '数据内容', + `sort` bigint(20) NULL DEFAULT 0 COMMENT '排序权重', + `status` tinyint(1) NULL DEFAULT 1 COMMENT '数据状态(0禁用,1启动)', + `deleted` tinyint(1) NULL DEFAULT 0 COMMENT '删除状态(0正常,1已删)', + `deleted_at` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '删除时间', + `deleted_by` bigint(20) NULL DEFAULT 0 COMMENT '删除用户', + `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `idx_system_base_type` (`type`) USING BTREE, + INDEX `idx_system_base_code` (`code`) USING BTREE, + INDEX `idx_system_base_name` (`name`(191)) USING BTREE +) ENGINE = InnoDB + AUTO_INCREMENT = 1 + CHARACTER SET = utf8mb4 + COLLATE = utf8mb4_unicode_ci COMMENT = '系统-字典' + ROW_FORMAT = COMPACT; + +-- 权限表增加身份权限字段 +ALTER TABLE `system_auth` + ADD COLUMN `utype` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '身份权限' AFTER `title`; + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/app/admin/controller/Auth.php b/app/admin/controller/Auth.php index c18441bea..6c73f11c9 100644 --- a/app/admin/controller/Auth.php +++ b/app/admin/controller/Auth.php @@ -16,6 +16,8 @@ namespace app\admin\controller; +use app\admin\model\SystemAuth; +use app\admin\model\SystemBase; use think\admin\Controller; use think\admin\service\AdminService; @@ -44,8 +46,18 @@ class Auth extends Controller public function index() { $this->title = '系统权限管理'; - $query = $this->_query($this->table)->dateBetween('create_at'); - $query->like('title,desc')->equal('status')->layTable(); + $this->types = (new SystemBase)->items('身份权限'); + $query = $this->_query(SystemAuth::class)->dateBetween('create_at'); + $query->like('title,desc')->equal('status,utype')->layTable(); + } + + /** + * 数据列表处理 + * @param array $data + */ + protected function _page_filter(array &$data) + { + (new SystemBase())->items('身份权限', $data, 'utype', 'utype_info'); } /** @@ -74,6 +86,17 @@ class Auth extends Controller $this->_form($this->table, 'form'); } + /** + * 表单处理数据 + * @param array $data + */ + protected function _form_filter(array &$data) + { + if ($this->request->isGet()) { + $this->bases = (new SystemBase())->items('身份权限'); + } + } + /** * 修改权限状态 * @auth true diff --git a/app/admin/controller/Base.php b/app/admin/controller/Base.php new file mode 100644 index 000000000..ad193e869 --- /dev/null +++ b/app/admin/controller/Base.php @@ -0,0 +1,124 @@ +applyTypes(); + $this->title = '数据字典管理'; + $query = $this->_query(SystemBase::class)->where(['deleted' => 0]); + $query->equal('type')->like('code,name,status')->dateBetween('create_at')->layTable(); + } + + /** + * 添加数据字典 + * @auth true + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function add() + { + $this->_form($this->table, 'form'); + } + + /** + * 编辑数据字典 + * @auth true + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function edit() + { + $this->_form($this->table, 'form'); + } + + /** + * 表单数据处理 + * @param array $data + */ + protected function _form_filter(array &$data) + { + if ($this->request->isGet()) { + $this->applyTypes(true); + } else { + $map = [['type', '=', $data['type']], ['code', '=', $data['code']], ['deleted', '=', 0]]; + if (isset($data['id'])) $map[] = ['id', '<>', $data['id']]; + if ($this->app->db->name($this->table)->where($map)->count() > 0) { + $this->error("同类型的数据编码已经存在!"); + } + } + } + + /** + * 修改数据状态 + * @auth true + * @throws \think\db\exception\DbException + */ + public function state() + { + $this->_save($this->table); + } + + /** + * 删除数据记录 + * @auth true + * @throws \think\db\exception\DbException + */ + public function remove() + { + $this->_delete($this->table); + } + + /** + * 初始化数据类型 + * @param false $add + */ + private function applyTypes(bool $add = false) + { + $query = $this->app->db->name($this->table)->where(['deleted' => 0]); + $this->types = $query->distinct(true)->order('id asc')->column('type'); + if (empty($this->types)) $this->types = ['身份权限']; + $this->type = input('get.type') ?: ($this->types[0] ?? '-'); + if ($add) $this->types[] = '--- 新增类型 ---'; + } +} \ No newline at end of file diff --git a/app/admin/controller/Oplog.php b/app/admin/controller/Oplog.php index f9e86be9c..01c482137 100644 --- a/app/admin/controller/Oplog.php +++ b/app/admin/controller/Oplog.php @@ -47,10 +47,12 @@ class Oplog extends Controller { $this->title = '系统日志管理'; $this->isSupper = AdminService::instance()->isSuper(); + // 读取数据类型 + $this->users = $this->app->db->name($this->table)->distinct(true)->column('username'); $this->actions = $this->app->db->name($this->table)->distinct(true)->column('action'); // 数据列表处理 $query = $this->_query($this->table)->dateBetween('create_at'); - $query->like('action,node,content,username,geoip')->layTable(); + $query->equal('username,action')->like('content,geoip,node')->layTable(); } /** diff --git a/app/admin/controller/Queue.php b/app/admin/controller/Queue.php index 843eb2dd2..399340140 100644 --- a/app/admin/controller/Queue.php +++ b/app/admin/controller/Queue.php @@ -69,8 +69,8 @@ class Queue extends Controller $this->title = '系统任务管理'; $this->iswin = ProcessService::instance()->iswin(); // 任务列表查询及分页 - $query = $this->_query($this->table)->dateBetween('create_at')->timeBetween('enter_time,exec_time'); - $query->like('code,title,command')->equal('status')->order('loops_time desc,id desc')->page(); + $query = $this->_query($this->table)->timeBetween('enter_time,exec_time')->dateBetween('create_at'); + $query->equal('status')->like('code,title,command')->order('loops_time desc,id desc')->page(); } /** @@ -120,5 +120,4 @@ class Queue extends Controller { $this->_delete($this->table); } - } diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 3287d03a4..4911c37ff 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -16,9 +16,10 @@ namespace app\admin\controller; +use app\admin\model\SystemBase; +use app\admin\model\SystemUser; use think\admin\Controller; use think\admin\service\AdminService; -use think\admin\service\SystemService; /** * 系统用户管理 @@ -60,7 +61,7 @@ class User extends Controller public function index() { $this->title = '系统用户管理'; - $query = $this->_query($this->table); + $query = $this->_query(SystemUser::class); // 加载对应数据列表 if (($this->type = input('type', 'all')) === 'all') { $query->where(['is_deleted' => 0, 'status' => 1]); @@ -153,8 +154,11 @@ class User extends Controller $data['authorize'] = arr2str($data['authorize'] ?? []); } else { $data['authorize'] = str2arr($data['authorize'] ?? ''); + // 用户权限管理 $query = $this->app->db->name('SystemAuth')->where(['status' => 1]); $this->authorizes = $query->order('sort desc,id desc')->select()->toArray(); + // 身份权限关联 + (new SystemBase)->items('身份权限', $this->authorizes, 'utype', 'utypeinfo'); } } diff --git a/app/admin/model/SystemAuth.php b/app/admin/model/SystemAuth.php new file mode 100644 index 000000000..926cde7d5 --- /dev/null +++ b/app/admin/model/SystemAuth.php @@ -0,0 +1,37 @@ + 1, 'deleted' => 0, 'type' => $type]; + $bases = $this->where($map)->order('sort desc,id desc')->column('code,name,content', 'code'); + if (count($data) > 0) foreach ($data as &$vo) $vo[$bind] = $bases[$vo[$field]] ?? []; + return $bases; + } + + /** + * 格式化创建时间 + * @param string $value + * @return string + */ + public function getCreateAtAttr(string $value): string + { + return format_datetime($value); + } +} \ No newline at end of file diff --git a/app/admin/model/SystemUser.php b/app/admin/model/SystemUser.php new file mode 100644 index 000000000..d4aa7bf46 --- /dev/null +++ b/app/admin/model/SystemUser.php @@ -0,0 +1,86 @@ +where($map)->order('sort desc,id desc'); + if (count($data) > 0) { + $users = $query->whereIn('id', array_unique(array_column($data, $field)))->column($fields, 'id'); + foreach ($data as &$vo) $vo[$target] = $users[$vo[$field]] ?? []; + return $users; + } else { + return $query->column($fields, 'id'); + } + } + + /** + * 通过身份类型获取 + * @param string $type 身份类型 + * @param string $fields 数据字段 + * @return array + */ + public function itemsByType(string $type, string $fields = 'username,nickname,headimg,status,is_deleted'): array + { + $rids = (new SystemAuth)->where(['status' => 1, 'utype' => $type])->column('id'); + return empty($rids) ? [] : $this->where(function (Query $query) use ($rids) { + foreach ($rids as $rid) $query->whereOr('authorize', 'like', "%,{$rid},%"); + })->where(['status' => 1, 'is_deleted' => 0])->column($fields, 'id'); + } + + /** + * 获取用户身份数据 + * @param mixed $uuid + * @return array + */ + public function rolesByUuid($uuid): array + { + $types = (new SystemBase)->items('身份权限'); + if (empty($types)) return []; + $rrids = str2arr($this->where(['id' => $uuid])->value('authorize') ?: ''); + if (empty($rrids)) return []; + $utypes = (new SystemAuth)->where(['status' => 1])->whereIn('id', $rrids)->column('utype'); + if (empty($utypes)) return []; + foreach ($types as $key => $type) if (!in_array($type, $utypes)) unset($types[$key]); + return array_values($types); + } + + /** + * 格式化登录时间 + * @param string $value + * @return string + */ + public function getLoginAtAttr(string $value): string + { + return format_datetime($value); + } + + /** + * 格式化创建时间 + * @param string $value + * @return string + */ + public function getCreateAtAttr(string $value): string + { + return format_datetime($value); + } +} \ No newline at end of file diff --git a/app/admin/view/auth/form.html b/app/admin/view/auth/form.html index c895e211e..d2d63d64a 100644 --- a/app/admin/view/auth/form.html +++ b/app/admin/view/auth/form.html @@ -1,18 +1,33 @@ -
+
+ {notempty name='bases'} +
+ 身份权限 + Identity Permissions + +
+ {/notempty} +
@@ -24,4 +39,8 @@ -
\ No newline at end of file + + \ No newline at end of file diff --git a/app/admin/view/auth/index.html b/app/admin/view/auth/index.html index 038a8296c..bebb1d7b9 100644 --- a/app/admin/view/auth/index.html +++ b/app/admin/view/auth/index.html @@ -6,7 +6,7 @@ - + {/block} @@ -22,15 +22,23 @@ $(function () { // 初始化表格组件 var $table = $('#RoleData').layTable({ - even: true, + even: true, height: 'full', sort: {field: 'sort desc,id', type: 'desc'}, cols: [[ {checkbox: true, fixed: true}, {field: 'sort', title: '排序权重', width: 100, align: 'center', sort: true, templet: '#SortInputTpl'}, {field: 'title', title: '权限名称', minWidth: 140, align: 'center', sort: false}, + { + field: 'utype', title: '身份权限', minWidth: 140, sort: false, templet: function (d) { + if ((d.utype_info || {}).name) { + return d.utype_info.name + ' ( ' + d.utype_info.code + ' ) ' + } + return '-'; + } + }, { field: 'desc', title: '权限描述', align: 'center', sort: false, templet: function (d) { - return d.desc || '未填写权限描述' + return d.desc || '-' } }, {field: 'create_at', title: '创建时间', align: 'center', sort: true}, @@ -39,15 +47,11 @@ ]] }); - // 设置表格最大高度 - $table.trigger('setFullHeight'); - // 数据状态切换操作 layui.form.on('switch(StatusSwitch)', function (obj) { $.form.load("{:url('state')}", {id: obj.value, status: obj.elem.checked > 0 ? 1 : 0}, 'post', function (ret) { if (ret.code < 1) $.msg.error(ret.info, 3, function () { - // 操作异常时重载数据 - $table.trigger('reload'); + $table.trigger('reload'); // 操作异常时重载数据 }); return false; }, false); diff --git a/app/admin/view/auth/index_search.html b/app/admin/view/auth/index_search.html index cf2d04ddc..4fbc02946 100644 --- a/app/admin/view/auth/index_search.html +++ b/app/admin/view/auth/index_search.html @@ -9,6 +9,22 @@ + {notempty name='types'} +
+ +
+ +
+
+ {/notempty} +
diff --git a/app/admin/view/base/form.html b/app/admin/view/base/form.html new file mode 100644 index 000000000..0195e929a --- /dev/null +++ b/app/admin/view/base/form.html @@ -0,0 +1,74 @@ +
+ +
+ +
+ 数据类型 + Database Type + {if isset($vo.type)} + + {else} + + + {/if} +

请选择数据类型,数据创建后不能再次修改哦 ~

+
+ +

请输入新的数据类型,数据创建后不能再次修改哦 ~

+
+
+ + + + + + + +
+ +
+ {notempty name='vo.id'}{/notempty} + +
+ + +
+ +
\ No newline at end of file diff --git a/app/admin/view/base/index.html b/app/admin/view/base/index.html new file mode 100644 index 000000000..b10f6b31e --- /dev/null +++ b/app/admin/view/base/index.html @@ -0,0 +1,86 @@ +{extend name='table'} + +{block name="button"} + + + + + + + +{/block} + +{block name="content"} +
+
    + {foreach $types as $t}{if isset($type) and $type eq $t} +
  • {$t}
  • + {else} +
  • {$t}
  • + {/if}{/foreach} +
+
+ {include file='base/index_search'} +
+
+
+{/block} + +{block name='script'} + + + + + + + + + + +{/block} \ No newline at end of file diff --git a/app/admin/view/base/index_search.html b/app/admin/view/base/index_search.html new file mode 100644 index 000000000..a750be2d2 --- /dev/null +++ b/app/admin/view/base/index_search.html @@ -0,0 +1,46 @@ +
+ 条件搜索 + + +
\ No newline at end of file diff --git a/app/admin/view/oplog/index.html b/app/admin/view/oplog/index.html index 15cda4e24..9820e5925 100644 --- a/app/admin/view/oplog/index.html +++ b/app/admin/view/oplog/index.html @@ -1,11 +1,11 @@ {extend name='table'} {block name="button"} - - - - + + + + {/block} @@ -20,6 +20,7 @@ {/block} \ No newline at end of file diff --git a/app/admin/view/oplog/index_search.html b/app/admin/view/oplog/index_search.html index 23362095d..ba2e13846 100644 --- a/app/admin/view/oplog/index_search.html +++ b/app/admin/view/oplog/index_search.html @@ -3,21 +3,28 @@