-- --------------------------------------------------------
-- 主机:                           127.0.0.1
-- 服务器版本:                        8.0.29 - MySQL Community Server - GPL
-- 服务器操作系统:                      Win64
-- HeidiSQL 版本:                  12.14.0.7165
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

-- 导出 ywxapp_dev 的数据库结构
CREATE DATABASE IF NOT EXISTS `ywxapp_dev` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `ywxapp_dev`;


-- 导出  表 __PREFIX__addon 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__addon` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(100) NOT NULL COMMENT '插件名称',
  `name` varchar(100) NOT NULL COMMENT '插件唯一标识',
  `description` text COMMENT '描述',
  `version` varchar(20) NOT NULL COMMENT '版本号',
  `author` varchar(100) DEFAULT NULL COMMENT '作者',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态：0-未安装，1-已安装未启用，2-已启用',
  `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '类型：1-系统插件，2-扩展插件',
  `create_at` int DEFAULT NULL COMMENT '安装时间',
  `update_at` int DEFAULT NULL COMMENT '更新时间',
  `config` text COMMENT '插件配置',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- 正在导出表  __PREFIX__addon 的数据：~0 rows (大约)

-- 导出  表 __PREFIX__backend_admin 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__backend_admin` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '管理员ID',
  `account` varchar(50) NOT NULL COMMENT '用户名',
  `nickname` varchar(50) NOT NULL COMMENT '昵称',
  `password` varchar(255) NOT NULL COMMENT '密码',
  `salt` varchar(20) NOT NULL DEFAULT '' COMMENT '密码盐值',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '电话',
  `dept_id` int NOT NULL DEFAULT '0' COMMENT '部门ID',
  `is_super` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否超级管理员',
  `avatar` varchar(255) DEFAULT '/static/avatar/default.jpg' COMMENT '头像',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态：1-启用，0-禁用',
  `login_ip` varchar(50) DEFAULT NULL COMMENT '最后登录IP',
  `login_time` int DEFAULT NULL COMMENT '最后登录时间',
  `login_count` int NOT NULL DEFAULT '0' COMMENT '登录次数',
  `fail_count` tinyint NOT NULL DEFAULT '0' COMMENT '登录失败次数',
  `need_reset` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要重置密码',
  `create_at` int DEFAULT NULL COMMENT '创建时间',
  `update_at` int DEFAULT NULL COMMENT '更新时间',
  `delete_at` int DEFAULT NULL COMMENT '删除时间（0表示未删除）',
  PRIMARY KEY (`id`),
  UNIQUE KEY `account` (`account`),
  KEY `idx_email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员表';

-- 正在导出表  __PREFIX__backend_admin 的数据：~1 rows (大约)
-- 注意：安装器 Installer.php 会在此之后创建管理员账号（取代预置账号），此处仅保留占位超级管理员。
-- 默认账号 admin / 密码 admin123 （bcrypt hash，公开占位，部署后请立即修改）
INSERT IGNORE INTO `__PREFIX__backend_admin` (`id`, `account`, `nickname`, `password`, `salt`, `email`, `mobile`, `dept_id`, `is_super`, `avatar`, `status`, `login_ip`, `login_time`, `login_count`, `fail_count`, `need_reset`, `create_at`, `update_at`, `delete_at`) VALUES
	(1, 'backend', '超级管理员', '$2y$10$N9UrBYZ1qG4p4v9xM7G6eO7m3qV2k5w8xY1z3aBcDeFgHiJkLmNoP', 'seed000000', 'admin@example.com', '13800138000', 0, 1, '/static/common/images/avatar.jpg', 1, NULL, NULL, 0, 0, 1, 0, 0, 0);

-- 导出  表 __PREFIX__backend_log 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__backend_log` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `aid` int NOT NULL COMMENT '管理员ID',
  `action` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '操作',
  `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'IP',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `create_at` int DEFAULT NULL,
  KEY `idx_aid` (`aid`),
  KEY `idx_create_at` (`create_at`),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT='管理员日志';

-- 正在导出表  __PREFIX__backend_log 的数据：~0 rows (大约)

-- 导出  表 __PREFIX__backend_power 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__backend_power` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '权限ID',
  `pid` int unsigned NOT NULL DEFAULT '0' COMMENT '父级ID（0表示根节点）',
  `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '权限名称',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '权限标识符',
  `type` tinyint unsigned NOT NULL COMMENT '类型：1-目录，2-菜单，3-按钮',
  `route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '路由路径或API接口',
  `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '图标类名',
  `sort` smallint unsigned NOT NULL DEFAULT '1' COMMENT '排序权重',
  `addon` varchar(20) COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '插件名称',
  `status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '状态：1=启用，0=禁用',
  `create_at` int NOT NULL DEFAULT '0',
  `update_at` int NOT NULL DEFAULT '0',
  `delete_at` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_name` (`name`) USING BTREE,
  KEY `idx_pid` (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限表';

-- 正在导出表  __PREFIX__backend_power 的数据：~44 rows (大约)
INSERT INTO `__PREFIX__backend_power` (`id`, `pid`, `title`, `name`, `type`, `route`, `icon`, `sort`, `addon`, `status`, `create_at`, `update_at`, `delete_at`) VALUES
	(1, 0, '控制台', 'console:index', 2, 'console/index', 'layui-icon layui-icon-chart-screen', 1, NULL, 1, 0, 0, 0),
	(2, 0, '应用', 'app', 1, '', 'layui-icon layui-icon-template-1', 2, NULL, 1, 0, 0, 0),
	(3, 0, '系统管理', 'system', 1, '/system', 'layui-icon layui-icon-set', 9, NULL, 1, 0, 0, 0),
	(4, 3, '系统设置', 'configure:index', 2, 'configure/index', '', 1, NULL, 1, 0, 0, 0),
	(5, 3, '权限菜单', 'power:index', 2, 'power/index', '', 1, NULL, 1, 0, 0, 0),
	(6, 3, '管理角色', 'role:index', 2, 'role/index', '', 1, NULL, 1, 0, 0, 0),
	(7, 3, '管理人员', 'admin:index', 2, 'admin/index', 'layui-icon ', 1, NULL, 1, 0, 0, 0),
	(8, 0, '插件管理', 'addon:index', 2, 'addon/index', 'layui-icon layui-icon layui-icon layui-icon-app', 9, NULL, 1, 0, 0, 0),
	(9, 0, '用户管理', 'User', 1, '/User', 'layui-icon layui-icon-user', 3, NULL, 1, 0, 0, 0),
	(10, 9, '用户列表', 'user:index', 2, 'user/index', '', 1, NULL, 1, 0, 0, 0),
	(11, 9, '用户分组', 'group:index', 2, 'group/index', '', 1, NULL, 1, 0, 0, 0),
	(12, 9, '分组权限', 'rule:index', 2, 'rule/index', '', 1, NULL, 1, 0, 0, 0),
	(13, 5, '创建权限', 'power:create', 3, 'power/create', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(14, 5, '保存权限', 'power:save', 4, 'power/save', 'layui-icon layui-icon ', 0, NULL, 1, 0, 0, 0),
	(15, 5, '更新权限', 'power:update', 3, 'power/update', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(16, 5, '编辑权限', 'power:edit', 4, 'power/edit', 'layui-icon layui-icon ', 0, NULL, 1, 0, 0, 0),
	(17, 5, '删除权限', 'power:delete', 3, 'power/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(18, 6, '创建角色', 'role:create', 3, 'role/create', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(19, 6, '保存角色', 'role:save', 4, 'role/save', 'layui-icon layui-icon ', 0, NULL, 1, 0, 0, 0),
	(20, 6, '更新角色', 'role:update', 3, 'role/update', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(21, 6, '删除角色', 'role:delete', 3, 'role/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(22, 6, '编辑角色', 'role:edit', 3, 'role/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(23, 7, '创建管理员', 'admin:create', 3, 'admin/create', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(24, 7, '保存管理员', 'admin:save', 3, 'admin/save', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(25, 7, '更新管理员', 'admin:update', 3, 'admin/update', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(26, 7, '删除管理员', 'admin:delete', 3, 'admin/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(27, 7, '编辑管理员', 'admin:edit', 3, 'admin/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(28, 10, '创建用户', 'user:create', 3, 'user/create', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(29, 10, '保存用户', 'user:save', 3, 'user/save', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(30, 10, '更新用户', 'user:update', 3, 'user/update', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(31, 10, '删除用户', 'user:delete', 3, 'user/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(32, 10, '编辑用户', 'user:edit', 3, 'user/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(33, 4, '保存配置', 'configure:save', 4, 'configure/index', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(34, 11, '创建分组', 'group:create', 3, 'group/create', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(35, 11, '保存分组', 'group:save', 4, 'group/save', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(36, 11, '编辑分组', 'group:edit', 3, 'group/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(37, 11, '更新分组', 'group:updae', 4, 'group/update', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(38, 11, '删除分组', 'group:delete', 4, 'group/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(39, 12, '创建权限', 'rule:create', 3, 'rule/create', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(40, 12, '保存权限', 'rule:save', 4, 'rule/save', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(41, 12, '编辑权限', 'rule:edit', 3, 'rule/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(42, 12, '更新权限', 'rule:update', 4, 'rule/update', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(43, 53, '友情链接', 'links:index', 2, 'links/index', 'layui-icon layui-icon ', 0, NULL, 1, 0, 0, 0),
	(44, 3, '框架升级', 'framework:index', 2, 'framework/index', 'layui-icon layui-icon-refresh', 0, NULL, 1, 0, 0, 0),
	(45, 43, '添加友链', 'links:add', 3, 'links/save', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(46, 43, '编辑友链', 'links:edit', 3, 'links/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(47, 43, '删除友链', 'links:delete', 3, 'links/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(48, 43, '友链回收站', 'links:recyclebin', 3, 'links/recyclebin', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(49, 43, '恢复友链', 'links:restore', 3, 'links/restore', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(50, 3, '蜘蛛统计', 'spider:index', 2, 'spider/index', 'layui-icon layui-icon-chart', 0, NULL, 1, 0, 0, 0),
	(51, 50, '蜘蛛汇总数据', 'spider:stats', 3, 'spider/stats', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(52, 50, '清理蜘蛛日志', 'spider:clear', 3, 'spider/clear', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(53, 0, '营运', 'operate', 1, '/operate', 'layui-icon layui-icon-engine', 4, NULL, 1, 0, 0, 0),
	(54, 53, '站点公告', 'notice:index', 2, 'notice/index', '', 1, NULL, 1, 0, 0, 0),
	(55, 53, '站点广告', 'ad:index', 2, 'ad/index', '', 2, NULL, 1, 0, 0, 0),
	(56, 53, '站点任务', 'task:index', 2, 'task/index', '', 3, NULL, 1, 0, 0, 0),
	(57, 53, '道具中心', 'prop:index', 2, 'prop/index', '', 4, NULL, 1, 0, 0, 0),
	(58, 53, '勋章中心', 'medal:index', 2, 'medal/index', '', 5, NULL, 1, 0, 0, 0),
	(59, 53, '短信服务', 'sms:index', 2, 'sms/index', '', 6, NULL, 1, 0, 0, 0),
	(60, 53, '站点帮助', 'help:index', 2, 'help/index', '', 7, NULL, 1, 0, 0, 0),
	(61, 53, '电子商务', 'shop:index', 2, 'shop/index', '', 8, NULL, 1, 0, 0, 0),
	(62, 53, '充值卡密', 'card:index', 2, 'card/index', '', 10, NULL, 1, 0, 0, 0),
	(63, 53, '积分规则', 'score:index', 2, 'score/index', '', 11, NULL, 1, 0, 0, 0),
	(64, 53, '主导航菜单', 'nav:index', 2, 'nav/index', 'layui-icon layui-icon-list', 12, NULL, 1, 0, 0, 0),
	(65, 64, '添加菜单', 'nav:add', 3, 'nav/save', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(66, 64, '编辑菜单', 'nav:edit', 3, 'nav/edit', 'layui-icon ', 0, NULL, 1, 0, 0, 0),
	(67, 64, '删除菜单', 'nav:delete', 3, 'nav/delete', 'layui-icon ', 0, NULL, 1, 0, 0, 0);
-- 导出  表 __PREFIX__backend_role 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__backend_role` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色名称',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '角色编码',
  `description` varchar(255) DEFAULT NULL COMMENT '角色描述',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态：1-启用，0-禁用',
  `create_at` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `update_at` int unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  `delete_at` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表';

-- 正在导出表  __PREFIX__backend_role 的数据：~4 rows (大约)
INSERT INTO `__PREFIX__backend_role` (`id`, `title`, `name`, `description`, `status`, `create_at`, `update_at`, `delete_at`) VALUES
	(1, '超级管理员', 'superadmin', '拥有所有权限', 1, 1672560000, 1768943789, NULL),
	(2, '管理员', 'backend', '管理员', 1, 1768944587, 1768944587, NULL);

-- 导出  表 __PREFIX__backend_role_access 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__backend_role_access` (
  `id` int NOT NULL AUTO_INCREMENT,
  `admin_id` int NOT NULL COMMENT '用户ID',
  `role_id` int NOT NULL COMMENT '角色ID',
  `create_at` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_role` (`admin_id`,`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色关联表';

-- 正在导出表  __PREFIX__backend_role_access 的数据：~5 rows (大约)
INSERT INTO `__PREFIX__backend_role_access` (`id`, `admin_id`, `role_id`, `create_at`) VALUES
	(1, 1, 1, 1672560000),
	(2, 2, 2, 1672560000),
	(3, 2, 3, 1672560000);

-- 导出  表 __PREFIX__backend_role_power 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__backend_role_power` (
  `id` int NOT NULL AUTO_INCREMENT,
  `role_id` int NOT NULL COMMENT '角色ID',
  `power_id` int NOT NULL COMMENT '权限ID',
  `create_at` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_permission` (`role_id`,`power_id`)
) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色权限关联表';

-- 正在导出表  __PREFIX__backend_role_power 的数据：~50 rows (大约)
INSERT INTO `__PREFIX__backend_role_power` (`id`, `role_id`, `power_id`, `create_at`) VALUES
	(40, 3, 5, 1672560000),
	(41, 3, 21, 1672560000),
	(43, 3, 26, 1672560000),
	(45, 3, 13, 1672560000),
	(46, 3, 22, 1672560000),
	(54, 4, 1, 1767639131);

-- 导出  表 __PREFIX__common_nav_menu 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__common_nav_menu` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `parent_id` int unsigned NOT NULL DEFAULT '0' COMMENT '父级ID（0=一级）',
  `title` varchar(50) NOT NULL DEFAULT '' COMMENT '菜单名称',
  `url` varchar(255) NOT NULL DEFAULT '' COMMENT '链接（controller/action 或 外链 http）',
  `icon` varchar(50) NOT NULL DEFAULT '' COMMENT '图标类',
  `sort` int NOT NULL DEFAULT '0' COMMENT '排序（越小越靠前）',
  `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态（1=显示 0=隐藏）',
  `create_at` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `update_at` int unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  `delete_at` int unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='前台主导航菜单';

-- 导出  表 __PREFIX__attachment 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__attachment` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '文件ID',
  `uid` int unsigned NOT NULL DEFAULT '0' COMMENT '所属用户ID',
  `module` varchar(20) NOT NULL DEFAULT 'backend' COMMENT '所属模块 (admin, index, api)',
  `path` varchar(500) NOT NULL COMMENT '文件相对路径 (如: 2026/01/21/filename.jpg)',
  `url` varchar(1000) NOT NULL COMMENT '文件访问URL (全路径)',
  `original` varchar(255) NOT NULL COMMENT '原始文件名',
  `name` varchar(255) NOT NULL COMMENT '存储文件名 (不含路径)',
  `size` int unsigned NOT NULL COMMENT '文件大小 (字节)',
  `ext` varchar(20) NOT NULL COMMENT '文件后缀',
  `mime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT 'MIME类型',
  `storage` varchar(20) NOT NULL DEFAULT 'local' COMMENT '存储引擎 (local, alioss, qcos, qiniu)',
  `driver_info` json DEFAULT NULL COMMENT '驱动特定信息 (如OSS的ETag, Bucket等)',
  `is_image` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否为图片',
  `width` smallint unsigned DEFAULT '0' COMMENT '图片宽度',
  `height` smallint unsigned DEFAULT '0' COMMENT '图片高度',
  `upload_ip` varchar(45) NOT NULL COMMENT '上传者IP',
  `create_at` int unsigned NOT NULL COMMENT '创建时间',
  `update_at` int unsigned NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_storage` (`storage`),
  KEY `idx_user` (`uid`),
  KEY `idx_path` (`path`(191)),
  KEY `idx_create_at` (`create_at`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='文件存储表';

-- 正在导出表  __PREFIX__attachment 的数据：~12 rows (大约)
INSERT INTO `__PREFIX__attachment` (`id`, `uid`, `module`, `path`, `url`, `original`, `name`, `size`, `ext`, `mime`, `storage`, `driver_info`, `is_image`, `width`, `height`, `upload_ip`, `create_at`, `update_at`) VALUES
	(1, 1, 'index', 'images/20260122/c7f0cc7d087f748773f35484f48ece98.jpg', '/storage/images/20260122/c7f0cc7d087f748773f35484f48ece98.jpg', 'd62a6059252dd42a2834a697a4724cb5c9ea15ce12ff.jpg', 'c7f0cc7d087f748773f35484f48ece98.jpg', 1000238, '', NULL, 'local', NULL, 1, 4096, 2734, '127.0.0.1', 1769058175, 1769058175),
	(2, 1, 'index', 'images/20260122/042eeecde2719cbe391ba75b1a2e3116.jpg', '/storage/images/20260122/042eeecde2719cbe391ba75b1a2e3116.jpg', 'd62a6059252dd42a2834a697a4724cb5c9ea15ce12ff.jpg', '042eeecde2719cbe391ba75b1a2e3116.jpg', 1000238, 'jpg', NULL, 'local', NULL, 1, 4096, 2734, '127.0.0.1', 1769058473, 1769058473),
	(3, 1, 'index', 'images/20260122/bef44a8800fb2f275fa32d0b861fc4fe.jpg', '/storage/images/20260122/bef44a8800fb2f275fa32d0b861fc4fe.jpg', '未标题-3.jpg', 'bef44a8800fb2f275fa32d0b861fc4fe.jpg', 40753, 'jpg', NULL, 'local', NULL, 1, 289, 431, '127.0.0.1', 1769058632, 1769058632),
	(4, 1, 'index', 'images/20260122/793045b0a8df2e24b40101d81277c80d.jpg', '/storage/images/20260122/793045b0a8df2e24b40101d81277c80d.jpg', '微信图片_2025-09-01_094126_376.jpg', '793045b0a8df2e24b40101d81277c80d.jpg', 86132, 'jpg', NULL, 'local', NULL, 1, 800, 800, '127.0.0.1', 1769058722, 1769058722),
	(5, 1, 'index', 'images/20260122/071aaf47501ffae96e3f5c0f634dd446.jpg', '/storage/images/20260122/071aaf47501ffae96e3f5c0f634dd446.jpg', 'd62a6059252dd42a2834a697a4724cb5c9ea15ce12ff.jpg', '071aaf47501ffae96e3f5c0f634dd446.jpg', 1000238, 'jpg', NULL, 'local', NULL, 1, 4096, 2734, '127.0.0.1', 1769058909, 1769058909),
	(6, 1, 'index', 'images/20260122/586a0ea4c0301af54cd627bdcc495ed2.jpg', '/storage/images/20260122/586a0ea4c0301af54cd627bdcc495ed2.jpg', 'd62a6059252dd42a2834a697a4724cb5c9ea15ce12ff.jpg', '586a0ea4c0301af54cd627bdcc495ed2.jpg', 1000238, 'jpg', NULL, 'local', NULL, 1, 4096, 2734, '127.0.0.1', 1769065458, 1769065458),
	(7, 1, 'index', 'images/20260122/46c3478e9f9e6f81632ad410c0193f80.jpg', '/storage/images/20260122/46c3478e9f9e6f81632ad410c0193f80.jpg', 'd62a6059252dd42a2834a697a4724cb5c9ea15ce12ff.jpg', '46c3478e9f9e6f81632ad410c0193f80.jpg', 1000238, 'jpg', NULL, 'local', NULL, 1, 4096, 2734, '127.0.0.1', 1769065562, 1769065562),
	(8, 1, 'index', 'images/20260122/0b619e79aaf60dbecd4f6c53a6599ba6.jpg', '/storage/images/20260122/0b619e79aaf60dbecd4f6c53a6599ba6.jpg', '未标题-3.jpg', '0b619e79aaf60dbecd4f6c53a6599ba6.jpg', 40753, 'jpg', 'image/jpeg', 'local', NULL, 1, 289, 431, '127.0.0.1', 1769065654, 1769065654),
	(9, 1, 'index', 'images/20260122/ec75503e71bec4ff826ad75ea20e627b.jpg', '/storage/images/20260122/ec75503e71bec4ff826ad75ea20e627b.jpg', 'd62a6059252dd42a2834a697a4724cb5c9ea15ce12ff.jpg', 'ec75503e71bec4ff826ad75ea20e627b.jpg', 1000238, 'jpg', 'image/jpeg', 'local', NULL, 1, 4096, 2734, '127.0.0.1', 1769065770, 1769065770),
	(10, 1, 'index', 'images/20260122/9da3a3c83af08c56e7231459b4d4e633.jpg', '/storage/images/20260122/9da3a3c83af08c56e7231459b4d4e633.jpg', 'd62a6059252dd42a2834a697a4724cb5c9ea15ce12ff.jpg', '9da3a3c83af08c56e7231459b4d4e633.jpg', 1000238, 'jpg', 'image/jpeg', 'local', NULL, 1, 4096, 2734, '127.0.0.1', 1769065848, 1769065848),
	(11, 1, 'index', 'images/20260122/a4a6b53937064487c67947849bef4e2f.jpg', '/storage/images/20260122/a4a6b53937064487c67947849bef4e2f.jpg', '1.jpg', 'a4a6b53937064487c67947849bef4e2f.jpg', 5463, 'jpg', 'image/jpeg', 'local', NULL, 1, 200, 200, '127.0.0.1', 1769090385, 1769090385),
	(12, 1, 'index', 'images/20260208/60f67fae5262f0ae19bf483aa4a5b926.png', '/storage/images/20260208/60f67fae5262f0ae19bf483aa4a5b926.png', '图片1.png', '60f67fae5262f0ae19bf483aa4a5b926.png', 24512, 'png', 'image/png', 'local', NULL, 1, 137, 139, '127.0.0.1', 1770484883, 1770484883);



-- 导出  表 __PREFIX__configure 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__configure` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL DEFAULT '' COMMENT '变量名',
  `group` varchar(30) DEFAULT '' COMMENT '分组',
  `title` varchar(100) DEFAULT '' COMMENT '变量标题',
  `tip` varchar(100) DEFAULT '' COMMENT '变量描述',
  `type` varchar(30) DEFAULT '' COMMENT '类型:string,text,int,bool,array,datetime,date,file',
  `value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '变量值',
  `content` text COMMENT '变量字典数据',
  `rule` varchar(100) DEFAULT '' COMMENT '验证规则',
  `extend` varchar(255) DEFAULT '' COMMENT '扩展属性',
  `setting` varchar(255) DEFAULT '' COMMENT '配置',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=COMPACT COMMENT='系统配置';

-- 正在导出表  __PREFIX__configure 的数据：~18 rows (大约)
INSERT INTO `__PREFIX__configure` (`id`, `name`, `group`, `title`, `tip`, `type`, `value`, `content`, `rule`, `extend`, `setting`) VALUES
	(1, 'site_name', 'basic', 'Site name', '请填写站点名称', 'string', 'YwxApp', '', 'required', '', ''),
	(2, 'beian', 'basic', 'Beian', '', 'string', '', '', '', '', ''),
	(3, 'cdnurl', 'basic', 'Cdn url', '如果静态资源使用第三方云储存请配置该值', 'string', '', '', '', '', ''),
	(4, 'version', 'basic', 'Version', '如果静态资源有变动请重新配置该值', 'string', '1.0.1', '', 'required', '', ''),
	(5, 'timezone', 'basic', 'Timezone', '', 'string', 'Asia/Shanghai', '', 'required', '', ''),
	(6, 'forbiddenip', 'basic', 'Forbidden ip', '一行一条记录', 'text', '', '', '', '', ''),
	(7, 'languages', 'basic', 'Languages', '', 'array', '{"backend":"zh-cn","frontend":"zh-cn"}', '', 'required', '', ''),
	(8, 'fixedpage', 'basic', 'Fixed page', '请尽量输入左侧菜单栏存在的链接', 'string', 'dashboard', '', 'required', '', ''),
	(11, 'mail_type', 'email', 'Mail type', '选择邮件发送方式', 'select', 'SMTP', 'Please select,SMTP,Mail', '', '', ''),
	(12, 'mail_smtp_host', 'email', 'Mail smtp host', '错误的配置发送邮件会导致服务器超时', 'string', 'smtp.qq.com', '', '', '', ''),
	(13, 'mail_smtp_port', 'email', 'Mail smtp port', '(不加密默认25,SSL默认465,TLS默认587)', 'string', '465', '', '', '', ''),
	(14, 'mail_smtp_user', 'email', 'Mail smtp user', '（填写完整用户名）', 'string', '10000', '', '', '', ''),
	(15, 'mail_smtp_pass', 'email', 'Mail smtp password', '（填写您的密码）', 'string', 'password', '', '', '', ''),
	(16, 'mail_verify_type', 'email', 'Mail vertify type', '（SMTP验证方式[推荐SSL]）', 'select', '', 'None,TLS,SSL', '', '', ''),
	(17, 'mail_from', 'email', 'Mail from', '', 'string', '10000@qq.com', '', '', '', ''),
	(19, 'telephone', 'contact', 'Telephone', '', 'string', ' ', '', '', '', ''),
	(20, 'site_qq', 'contact', 'site_qq', '', 'string', '', '', '', '', ''),
	(21, 'site_email', 'contact', 'site_email', '', 'string', 'admin@ywxapp.cn', '', '', '', '');

-- 导出  表 __PREFIX__links 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__links` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `title` varchar(255) NOT NULL COMMENT '网站标题',
  `url` varchar(255) NOT NULL COMMENT '链接地址',
  `logo` varchar(255) DEFAULT '' COMMENT '网站Logo地址',
  `description` varchar(500) DEFAULT '' COMMENT '网站描述',
  `sort` int DEFAULT '0' COMMENT '排序值，越大越靠前',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态：1启用，0禁用',
  `create_at` int DEFAULT '0' COMMENT '创建时间',
  `update_at` int DEFAULT '0' COMMENT '更新时间',
  `delete_at` int DEFAULT NULL COMMENT '软删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='友情链接表';

-- 正在导出表  __PREFIX__links 的数据：~1 rows (大约)
INSERT INTO `__PREFIX__links` (`id`, `title`, `url`, `logo`, `description`, `sort`, `status`, `create_at`, `update_at`) VALUES
	(3, '示例站点', 'https://example.com', '/static/common/img/link.png', '', 0, 1, 1778788611, 1778788611);

-- 导出  表 __PREFIX__spider_log 结构（全站搜索蜘蛛抓取明细，由全局中间件 SpiderStat 写入）
CREATE TABLE IF NOT EXISTS `__PREFIX__spider_log` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `spider` varchar(20) NOT NULL DEFAULT '' COMMENT '蜘蛛标识',
  `url` varchar(500) NOT NULL DEFAULT '' COMMENT '抓取URL',
  `ip` varchar(45) NOT NULL DEFAULT '' COMMENT '来源IP',
  `app` varchar(20) NOT NULL DEFAULT '' COMMENT '应用名',
  `user_agent` varchar(500) NOT NULL DEFAULT '' COMMENT 'User-Agent',
  `http_code` smallint unsigned NOT NULL DEFAULT '200' COMMENT '响应状态码',
  `create_at` int NOT NULL DEFAULT '0' COMMENT '抓取时间',
  PRIMARY KEY (`id`),
  KEY `idx_spider_time` (`spider`,`create_at`),
  KEY `idx_create_at` (`create_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='搜索蜘蛛抓取日志';

-- 导出  表 __PREFIX__spider_stat 结构（按日聚合，报表免全表扫描）
CREATE TABLE IF NOT EXISTS `__PREFIX__spider_stat` (
  `stat_date` date NOT NULL COMMENT '统计日期',
  `spider` varchar(20) NOT NULL DEFAULT '' COMMENT '蜘蛛标识',
  `count` int unsigned NOT NULL DEFAULT '0' COMMENT '抓取次数',
  PRIMARY KEY (`stat_date`,`spider`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='搜索蜘蛛按日统计';

-- 导出  表 __PREFIX__sms 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__sms` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mobile` varchar(20) NOT NULL COMMENT '手机号',
  `code` varchar(10) NOT NULL COMMENT '验证码',
  `event` varchar(20) DEFAULT 'login' COMMENT '类型 login:登录 register:注册',
  `times` int DEFAULT '0' COMMENT '验证次数',
  `ip` varchar(50) DEFAULT NULL COMMENT '发送IP',
  `create_at` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_mobile` (`mobile`),
  KEY `idx_times` (`times`),
  KEY `idx_create_at` (`create_at`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='短信日志表';

 
-- 导出  表 __PREFIX__member_user 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_user` (
  `uid` int unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `account` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '用户名',
  `nickname` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '',
  `create_ip` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '注册IP',
  `update_at` int unsigned DEFAULT '0' COMMENT '最后登录时间',
  `update_ip` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '最后登录IP',
  `avatar` varchar(255) DEFAULT '' COMMENT '头像',
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '邮箱',
  `mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '手机号',
  `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '密码',
  `gid` int unsigned NOT NULL DEFAULT '2' COMMENT '用户组ID',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(1:正常,0:禁用,-1:删除)',
  `vip_expire` int unsigned NOT NULL DEFAULT '0' COMMENT '会员到期时间(0=未开通/永久)',
  `vip_level` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '会员等级(0普通,1标准,2专业)',
`score` int unsigned NOT NULL DEFAULT '0' COMMENT '积分(做任务/互动获得)',
  `email_verified` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '邮箱是否验证',
  `create_at` int unsigned NOT NULL DEFAULT '0' COMMENT '注册时间',
  `delete_at` int DEFAULT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `username` (`account`) USING BTREE,
  KEY `status` (`status`),
  KEY `group_id` (`gid`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=88889463 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表';

;

-- 导出  表 __PREFIX__member_bill 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_bill` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uid` int NOT NULL COMMENT '用户ID',
  `type` tinyint(1) NOT NULL COMMENT '交易类型：1-充值，2-消费，3-退款',
  `amount` decimal(10,2) NOT NULL COMMENT '金额',
  `currency` tinyint(1) DEFAULT '1' COMMENT '货币类型：1-人民币，2-金币',
  `channel` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '支付渠道',
  `order_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '订单号',
  `status` tinyint(1) DEFAULT '0' COMMENT '状态：0-待支付，1-成功，2-失败',
  `description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '描述',
  `create_at` int DEFAULT '0' COMMENT '创建时间',
  `update_at` int DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `idx_uid` (`uid`),
  KEY `idx_order_no` (`order_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='交易记录表';

-- 正在导出表  __PREFIX__member_bill 的数据：~0 rows (大约)

-- 导出  表 __PREFIX__member_group 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_group` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '组名',
  `title` varchar(50) NOT NULL DEFAULT '' COMMENT '组标题',
  `description` varchar(255) DEFAULT '' COMMENT '描述',
  `points_min` int NOT NULL DEFAULT '0' COMMENT '最小积分',
  `points_max` int NOT NULL DEFAULT '0' COMMENT '最大积分',
  `is_admin` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否管理组',
  `sort` int unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `delete_at` int DEFAULT '0',
  `create_at` int DEFAULT '0',
  `update_at` int DEFAULT '0',
  `status` int DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `points_range` (`points_min`,`points_max`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户组表';

-- 正在导出表  __PREFIX__member_group 的数据：~2 rows (大约)
INSERT INTO `__PREFIX__member_group` (`id`, `name`, `title`, `description`, `points_min`, `points_max`, `is_admin`, `sort`, `delete_at`, `create_at`, `update_at`, `status`) VALUES
	(1, 'vip', '普通会员', '普通会员', 0, 0, 1, 1, 0, 0, 0, 1),
	(2, 'vip', '特殊会员', '特殊会员', 0, 100, 0, 2, 0, 0, 0, 1),
	(3, 'vip', '付费会员', '付费开通会员', 0, 0, 0, 3, 0, 0, 0, 1);

-- 导出  表 __PREFIX__member_group_access 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_group_access` (
  `uid` int NOT NULL COMMENT '用户ID',
  `gid` int NOT NULL COMMENT '角色ID',
  `create_at` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  UNIQUE KEY `user_group` (`uid`,`gid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色关联表';


-- 导出  表 __PREFIX__member_group_rule 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_group_rule` (
  `gid` int NOT NULL COMMENT '角色ID',
  `rid` int NOT NULL COMMENT '权限ID',
  `create_at` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  UNIQUE KEY `group_rule` (`gid`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色权限关联表';

-- 正在导出表  __PREFIX__member_group_rule 的数据：~9 rows (大约)
INSERT INTO `__PREFIX__member_group_rule` (`gid`, `rid`, `create_at`) VALUES
	(1, 1, 1768983615),
	(1, 2, 1768983615),
	(1, 3, 1768983615),
	(1, 4, 1768983615),
	(1, 5, 1768983615),
	(1, 8, 1768983615),
	(2, 1, 1768943383),
	(2, 2, 1768943383),
	(2, 3, 1768943383);

-- 导出  表 __PREFIX__member_log 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_log` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `uid` int NOT NULL COMMENT '用户ID',
  `action` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '操作',
  `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'IP',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
  `create_at` int DEFAULT NULL,
  KEY `idx_aid` (`uid`),
  KEY `idx_create_at` (`create_at`),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='会员日志';

;

-- 导出  表 __PREFIX__member_profile 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_profile` (
  `uid` int unsigned NOT NULL COMMENT '用户ID',
  `realname` varchar(30) DEFAULT '' COMMENT '真实姓名',
  `gender` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '性别(0:保密,1:男,2:女)',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `qq` varchar(15) DEFAULT '' COMMENT 'QQ',
  `wechat` varchar(50) DEFAULT '' COMMENT '微信',
  `signature` varchar(255) DEFAULT '' COMMENT '签名',
  `address` varchar(255) DEFAULT '' COMMENT '地址',
  `bio` text COMMENT '个人简介',
  `latitude` decimal(10,8) DEFAULT NULL COMMENT '纬度',
  `longitude` decimal(10,8) DEFAULT NULL COMMENT '经度',
  `geo_hash` varchar(12) NOT NULL DEFAULT '' COMMENT '地理哈希(同城粗匹配)',
  `resideprovince` varchar(50) NOT NULL DEFAULT '' COMMENT '居住省份',
  `residecity` varchar(50) NOT NULL DEFAULT '' COMMENT '居住城市',
  `residedist` varchar(50) NOT NULL DEFAULT '' COMMENT '居住区县',
  `height` smallint unsigned NOT NULL DEFAULT '0' COMMENT '身高(cm)',
  `weight` smallint unsigned NOT NULL DEFAULT '0' COMMENT '体重(kg)',
  `constellation` varchar(10) NOT NULL DEFAULT '' COMMENT '星座',
  `zodiac` varchar(10) NOT NULL DEFAULT '' COMMENT '生肖',
  `lookingfor` varchar(50) NOT NULL DEFAULT '' COMMENT '交友目的',
  `affectivestatus` varchar(20) NOT NULL DEFAULT '' COMMENT '情感状态',
  `education` varchar(20) NOT NULL DEFAULT '' COMMENT '学历',
  `occupation` varchar(50) NOT NULL DEFAULT '' COMMENT '职业',
  `revenue` varchar(20) NOT NULL DEFAULT '' COMMENT '年收入',
  `bloodtype` varchar(5) NOT NULL DEFAULT '' COMMENT '血型',
  `is_realname` tinyint(1) NOT NULL DEFAULT '0' COMMENT '真人认证:0未认证,1已认证',
  `online_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '在线状态:0离线,1在线,2隐身',
  `last_active_at` int unsigned NOT NULL DEFAULT '0' COMMENT '最后活跃时间',
  `privacy_config` varchar(512) NOT NULL DEFAULT '' COMMENT '隐私设置JSON',
  `canceled_at` int unsigned NOT NULL DEFAULT '0' COMMENT '注销时间(>0表示已注销)',
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户资料表';

-- 正在导出表  __PREFIX__member_profile 的数据：~0 rows (大约)

-- 导出  表 __PREFIX__member_rule 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_rule` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '权限ID',
  `pid` int unsigned NOT NULL DEFAULT '0' COMMENT '父级ID（0表示根节点）',
  `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '权限名称',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '权限标识符',
  `type` tinyint unsigned NOT NULL COMMENT '类型：1-目录，2-菜单，3-按钮',
  `module` varchar(50) COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'frontend' COMMENT '模块：frontend-前端，member-会员中心',
  `route` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '路由路径或API接口',
  `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '图标类名',
  `sort` smallint unsigned NOT NULL DEFAULT '1' COMMENT '排序权重',
  `status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '状态：1=启用，0=禁用',
  `create_at` int NOT NULL DEFAULT '0',
  `update_at` int NOT NULL DEFAULT '0',
  `delete_at` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_name` (`name`) USING BTREE,
  KEY `idx_pid` (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限表';

-- 正在导出表  __PREFIX__member_rule 的数据：~4 rows (大约)
INSERT INTO `__PREFIX__member_rule` (`id`, `pid`, `title`, `name`, `type`, `module`, `route`, `icon`, `sort`, `status`, `create_at`, `update_at`, `delete_at`) VALUES
	(1, 0, '数据面板', 'console:index', 2, 'member', '/views/console', 'layui-icon-chart-screen', 0, 1, 0, 1777461483, 0),
	(2, 0, '用户信息', 'member', 1, 'member', '', 'layui-icon layui-icon layui-icon ', 0, 1, 0, 1777458525, 0),
	(3, 2, '我的资料', 'user:profile', 1, 'member', 'user/profile', '', 0, 1, 0, 1777461899, 0),
	(9, 0, '首页', 'index:index', 1, 'frontend', 'Index/index', '', 0, 1, 1777464473, 1777464473, 0);

-- 导出  表 __PREFIX__member_wallets 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__member_wallets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uid` int NOT NULL COMMENT '用户ID',
  `balance` decimal(10,2) DEFAULT '0.00' COMMENT '余额',
  `coins` int DEFAULT '0' COMMENT '金币数量',
  `total_recharge` decimal(10,2) DEFAULT '0.00' COMMENT '累计充值',
  `total_consume` decimal(10,2) DEFAULT '0.00' COMMENT '累计消费',
  `create_at` int DEFAULT '0',
  `update_at` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户钱包表';



/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;


-- ----------------------------
-- 营运模块数据表
-- ----------------------------
CREATE TABLE IF NOT EXISTS `__PREFIX__notice` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '公告标题',
  `content` text COMMENT '公告内容',
  `author` varchar(50) NOT NULL DEFAULT '' COMMENT '发布人',
  `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '类型 1系统维护 2活动公告 3版本更新 4其他',
  `is_top` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否置顶 0否 1是',
  `start_time` int(11) NOT NULL DEFAULT 0 COMMENT '展示开始时间 0=长期',
  `end_time` int(11) NOT NULL DEFAULT 0 COMMENT '展示结束时间 0=长期',
  `view_count` int(11) NOT NULL DEFAULT 0 COMMENT '浏览量',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态 0禁用 1启用',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `idx_type` (`type`),
  KEY `idx_is_top` (`is_top`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站点公告';

CREATE TABLE IF NOT EXISTS `__PREFIX__ad` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '广告标题',
  `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '类型 1图片2文字3代码',
  `position` varchar(50) NOT NULL DEFAULT '' COMMENT '广告位标识 home_top首页顶部 home_side首页侧边 popup全站弹窗 list_bottom列表底部',
  `content` text COMMENT '广告内容/代码',
  `url` varchar(255) NOT NULL DEFAULT '' COMMENT '跳转链接',
  `image` varchar(255) NOT NULL DEFAULT '' COMMENT '图片地址',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `idx_position` (`position`),
  KEY `idx_status_sort` (`status`,`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站点广告';

CREATE TABLE IF NOT EXISTS `__PREFIX__task` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '任务标题',
  `description` text COMMENT '任务描述',
  `reward_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '奖励类型',
  `reward_num` int(11) NOT NULL DEFAULT 0 COMMENT '奖励数量/道具ID',
  `prop_num` int(11) NOT NULL DEFAULT 1 COMMENT '道具数量(奖励类型为道具时生效)',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站点任务';

CREATE TABLE IF NOT EXISTS `__PREFIX__member_prop` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `prop_id` int unsigned NOT NULL DEFAULT '0' COMMENT '道具ID',
  `num` int unsigned NOT NULL DEFAULT '1' COMMENT '数量',
  `create_at` int(11) NOT NULL DEFAULT '0' COMMENT '获得时间',
  PRIMARY KEY (`id`),
  KEY `idx_uid` (`uid`),
  KEY `idx_uid_prop` (`uid`,`prop_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户拥有道具';

CREATE TABLE IF NOT EXISTS `__PREFIX__member_task` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `task_id` int unsigned NOT NULL DEFAULT '0' COMMENT '任务ID',
  `reward_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '实际发放奖励类型',
  `reward_num` int(11) NOT NULL DEFAULT '0' COMMENT '实际发放数量',
  `create_at` int(11) NOT NULL DEFAULT '0' COMMENT '领取时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_uid_task` (`uid`,`task_id`),
  KEY `idx_uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户任务领取记录';

CREATE TABLE IF NOT EXISTS `__PREFIX__prop` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '道具名称',
  `icon` varchar(255) NOT NULL DEFAULT '' COMMENT '图标',
  `price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '价格',
  `description` text COMMENT '描述',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='道具中心';

CREATE TABLE IF NOT EXISTS `__PREFIX__medal` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '勋章名称',
  `image` varchar(255) NOT NULL DEFAULT '' COMMENT '图片',
  `description` text COMMENT '描述',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='勋章中心';

CREATE TABLE IF NOT EXISTS `__PREFIX__member_medal` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `medal_id` int unsigned NOT NULL DEFAULT '0' COMMENT '勋章ID',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '获得时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_uid_medal` (`uid`,`medal_id`),
  KEY `idx_uid` (`uid`),
  KEY `idx_medal` (`medal_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户拥有勋章';

CREATE TABLE IF NOT EXISTS `__PREFIX__sms` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '模板名称',
  `code` varchar(50) NOT NULL DEFAULT '' COMMENT '模板标识',
  `content` text COMMENT '模板内容',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='短信服务';

CREATE TABLE IF NOT EXISTS `__PREFIX__help` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `category` varchar(50) NOT NULL DEFAULT '' COMMENT '帮助分类（如：新手指南/常见问题/使用说明）',
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '帮助标题',
  `content` text COMMENT '帮助内容',
  `view_count` int(11) NOT NULL DEFAULT 0 COMMENT '浏览量',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `idx_category` (`category`),
  KEY `idx_status_sort` (`status`,`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='站点帮助';

CREATE TABLE IF NOT EXISTS `__PREFIX__shop` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '商品名称',
  `price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '价格',
  `stock` int(11) NOT NULL DEFAULT 0 COMMENT '库存',
  `description` text COMMENT '描述',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='电子商务';

CREATE TABLE IF NOT EXISTS `__PREFIX__card` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL DEFAULT 0 COMMENT '兑换会员ID（0未兑换）',
  `batch_no` varchar(30) NOT NULL DEFAULT '' COMMENT '批量生成批次号',
  `cardno` varchar(100) NOT NULL DEFAULT '' COMMENT '卡号',
  `password` varchar(100) NOT NULL DEFAULT '' COMMENT '密码',
  `amount` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '面值',
  `status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '状态 0未售1已售2已用',
  `use_time` int(11) NOT NULL DEFAULT 0 COMMENT '使用时间',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `idx_cardno` (`cardno`),
  KEY `idx_batch_no` (`batch_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值卡密';

-- 导出  表 __PREFIX__score_rule 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__score_rule` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则名称',
  `action` varchar(50) NOT NULL DEFAULT '' COMMENT '触发动作标识(task_complete/signin/register等)',
  `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1获取2消费',
  `value` int(11) NOT NULL DEFAULT 0 COMMENT '变动值',
  `status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态 0禁用1启用',
  `sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  `update_at` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
  `delete_at` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `idx_action` (`action`),
  KEY `idx_status_sort` (`status`,`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分规则';

-- 导出  表 __PREFIX__score_log 结构
CREATE TABLE IF NOT EXISTS `__PREFIX__score_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
  `rule_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '关联规则ID',
  `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1收入2支出',
  `value` int(11) NOT NULL DEFAULT 0 COMMENT '变动值',
  `balance` int(11) NOT NULL DEFAULT 0 COMMENT '变动后余额',
  `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
  `create_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_uid` (`uid`),
  KEY `idx_uid_create` (`uid`,`create_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分流水';

