-- 数据库结构生成时间: 2026-04-09 14:03:43

CREATE TABLE `wa_address` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `network` varchar(10) DEFAULT 'BEP-20',
  `address` varchar(80) NOT NULL,
  `status` tinyint(1) DEFAULT '1',
  `created_at` int NOT NULL DEFAULT '0',
  `updated_at` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `network` (`network`),
  KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=770 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `wa_admin` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `username` varchar(32) NOT NULL COMMENT '用户名',
  `nickname` varchar(40) NOT NULL COMMENT '昵称',
  `password` varchar(255) NOT NULL COMMENT '密码',
  `avatar` varchar(255) DEFAULT '/app/admin/avatar.png' COMMENT '头像',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `mobile` varchar(16) DEFAULT NULL COMMENT '手机',
  `totp_secret` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `created_at` int DEFAULT NULL,
  `updated_at` int DEFAULT NULL,
  `login_at` int DEFAULT NULL,
  `status` tinyint DEFAULT NULL COMMENT '禁用',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员表';

CREATE TABLE `wa_admin_access` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `role_id` int NOT NULL COMMENT '角色id',
  `admin_id` int NOT NULL COMMENT '管理员id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_admin_id` (`role_id`,`admin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员角色表';

CREATE TABLE `wa_admin_role` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(80) NOT NULL COMMENT '角色组',
  `rules` text COMMENT '权限',
  `created_at` int DEFAULT NULL,
  `updated_at` int DEFAULT NULL,
  `pid` int unsigned DEFAULT NULL COMMENT '父级',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员角色';

CREATE TABLE `wa_admin_rule` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `extend` varchar(255) DEFAULT NULL,
  `title` varchar(255) NOT NULL COMMENT '标题',
  `icon` varchar(255) DEFAULT NULL COMMENT '图标',
  `key` varchar(255) NOT NULL COMMENT '标识',
  `pid` int unsigned DEFAULT '0' COMMENT '上级菜单',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `href` varchar(255) DEFAULT NULL COMMENT 'url',
  `type` int NOT NULL DEFAULT '1' COMMENT '类型',
  `weight` int DEFAULT '0' COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=293 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限规则';

CREATE TABLE `wa_album` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `groupID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '群ID',
  `userID` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题',
  `image` int NOT NULL COMMENT '封面ID',
  `total` int NOT NULL COMMENT '相片总数',
  `status` tinyint(1) NOT NULL COMMENT '状态',
  `created_at` int NOT NULL COMMENT '创建时间',
  `updated_at` int NOT NULL COMMENT '更新时间',
  `weigh` int NOT NULL COMMENT '排序权重',
  PRIMARY KEY (`id`),
  KEY `groupID` (`groupID`,`userID`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_archives` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(10) NOT NULL DEFAULT 'article',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `category_id` int DEFAULT NULL COMMENT '分类ID',
  `title` varchar(255) DEFAULT '' COMMENT '文章标题',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '标识',
  `flag` varchar(100) DEFAULT '' COMMENT '标志',
  `style` varchar(100) DEFAULT '' COMMENT '样式',
  `image` varchar(255) DEFAULT '' COMMENT '缩略图',
  `images` varchar(1500) DEFAULT '' COMMENT '组图',
  `tags` varchar(255) DEFAULT '' COMMENT 'TAG',
  `intro` text,
  `weigh` int NOT NULL DEFAULT '0' COMMENT '权重',
  `views` int unsigned NOT NULL DEFAULT '0' COMMENT '浏览次数',
  `created_at` int DEFAULT NULL COMMENT '创建时间',
  `updated_at` int DEFAULT NULL COMMENT '更新时间',
  `publishtime` int DEFAULT NULL COMMENT '发布时间',
  `deleted_at` int DEFAULT NULL COMMENT '删除时间',
  `memo` varchar(100) DEFAULT '' COMMENT '备注',
  `status` enum('normal','hidden','rejected','pulloff') NOT NULL DEFAULT 'normal' COMMENT '状态',
  PRIMARY KEY (`id`),
  KEY `weigh` (`weigh`,`publishtime`)
) ENGINE=InnoDB AUTO_INCREMENT=618 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='内容表';

CREATE TABLE `wa_archives_read` (
  `user_id` int NOT NULL,
  `source_id` int DEFAULT NULL,
  `value` tinyint(1) DEFAULT '1',
  KEY `user_id` (`user_id`) USING BTREE,
  KEY `source_id` (`source_id`) USING BTREE,
  KEY `value` (`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_card` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL,
  `title` varchar(64) NOT NULL,
  `total` int NOT NULL DEFAULT '0',
  `used` int DEFAULT '0',
  `expires` int NOT NULL,
  `days` int NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` int NOT NULL,
  `updated_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `wa_category` (
  `id` int NOT NULL AUTO_INCREMENT,
  `title` varchar(64) NOT NULL,
  `type` varchar(10) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` int DEFAULT NULL,
  `updated_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `wa_cdkey` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` int DEFAULT NULL,
  `category_id` int DEFAULT NULL,
  `account` varchar(64) NOT NULL,
  `passworrd` varchar(64) DEFAULT NULL,
  `days` int DEFAULT '0',
  `expires` int NOT NULL,
  `is_used` tinyint(1) NOT NULL DEFAULT '0',
  `record_id` int DEFAULT NULL,
  `use_time` int DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` int NOT NULL,
  `updated_at` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account` (`account`)
) ENGINE=InnoDB AUTO_INCREMENT=11314 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `wa_collection` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL DEFAULT '0',
  `content_type` enum('text','image','file','video','link','audio') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'text' COMMENT '内容类型',
  `content` json NOT NULL COMMENT '收藏内容本体',
  `tags` varchar(255) DEFAULT NULL COMMENT '用户自定义标签',
  `is_pinned` tinyint(1) DEFAULT '0' COMMENT '是否置顶',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` int DEFAULT NULL,
  `updated_at` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `wa_config` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) 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',
  `visible` varchar(255) DEFAULT '' COMMENT '可见条件',
  `is_show` tinyint NOT NULL DEFAULT '1',
  `value` text 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=55 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统配置';

CREATE TABLE `wa_content` (
  `id` int NOT NULL,
  `content` longtext NOT NULL,
  `content1` longtext,
  `content2` longtext,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='内容';

CREATE TABLE `wa_files` (
  `id` int NOT NULL AUTO_INCREMENT,
  `adapter` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `category` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `user_id` int DEFAULT NULL COMMENT '用户ID',
  `admin_id` int DEFAULT NULL,
  `origin_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '本地文件名',
  `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '保存路径',
  `file_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `size` int DEFAULT NULL COMMENT '大小',
  `mime_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'mime类型',
  `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '扩展名',
  `file_height` int DEFAULT NULL COMMENT '图片高度',
  `file_width` int DEFAULT NULL COMMENT 'tup宽度',
  `sha1` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'sha1确定文件唯一性',
  `use_count` int DEFAULT NULL COMMENT '关联次数',
  `created_at` int DEFAULT NULL COMMENT '创建时间',
  `updated_at` int DEFAULT NULL COMMENT '更新时间',
  `deleted_at` int DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2272 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_friend_circle` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` int NOT NULL COMMENT '用户ID',
  `releaseType` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '内容',
  `files` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '图片列表(JSON)',
  `address` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `like_count` int NOT NULL DEFAULT '0' COMMENT '点赞数',
  `comment_count` int NOT NULL DEFAULT '0' COMMENT '评论数',
  `created_at` int NOT NULL COMMENT '创建时间',
  `updated_at` int NOT NULL COMMENT '更新时间',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:隐藏 1:正常)',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `status` (`status`),
  KEY `created_at` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=375 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈动态表';

CREATE TABLE `wa_friend_circle_comment` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `circle_id` int NOT NULL COMMENT '朋友圈动态ID',
  `user_id` int NOT NULL COMMENT '用户ID',
  `reply_user_id` int NOT NULL DEFAULT '0' COMMENT '回复的用户ID(0表示直接评论)',
  `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '评论内容',
  `created_at` int NOT NULL COMMENT '创建时间',
  `updated_at` int NOT NULL COMMENT '更新时间',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:隐藏 1:正常)',
  PRIMARY KEY (`id`),
  KEY `circle_id` (`circle_id`),
  KEY `user_id` (`user_id`),
  KEY `reply_user_id` (`reply_user_id`),
  KEY `status` (`status`),
  KEY `created_at` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈评论表';

CREATE TABLE `wa_friend_circle_like` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `circle_id` int NOT NULL COMMENT '朋友圈动态ID',
  `user_id` int NOT NULL COMMENT '用户ID',
  `created_at` int NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `circle_user` (`circle_id`,`user_id`),
  KEY `circle_id` (`circle_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=156 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈点赞表';

CREATE TABLE `wa_friend_circle_setting` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` int NOT NULL COMMENT '用户ID',
  `bg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '背景',
  `allow_days` int NOT NULL COMMENT '允许查看最近几天的朋友圈',
  `created_at` int NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='朋友圈设置';

CREATE TABLE `wa_gallery` (
  `id` int NOT NULL AUTO_INCREMENT,
  `album_id` int DEFAULT NULL COMMENT '相册ID',
  `group_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `user_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '1',
  `created_at` int NOT NULL,
  `updated_at` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `album_id` (`album_id`),
  KEY `group_id` (`group_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=379 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_payment_order` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `order_no` varchar(50) NOT NULL COMMENT '订单号',
  `trade_no` varchar(100) DEFAULT NULL COMMENT '支付交易号',
  `pay_type` varchar(20) NOT NULL COMMENT '支付类型: alipay, wechat',
  `type` varchar(20) NOT NULL DEFAULT 'goods' COMMENT '订单类型: recharge(充值), goods(商品), service(服务), other(其他)',
  `amount` decimal(10,2) NOT NULL COMMENT '支付金额',
  `subject` varchar(255) NOT NULL COMMENT '订单标题',
  `status` varchar(20) NOT NULL DEFAULT 'PENDING' COMMENT '订单状态: PENDING, SUCCESS, FAIL, CLOSED, REFUNDED',
  `extra` text COMMENT '额外信息',
  `created_at` int NOT NULL COMMENT '创建时间',
  `updated_at` int NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_no` (`order_no`),
  KEY `pay_type` (`pay_type`),
  KEY `type` (`type`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='支付订单表';

CREATE TABLE `wa_payment_refund` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `order_no` varchar(50) NOT NULL COMMENT '原订单号',
  `refund_no` varchar(50) NOT NULL COMMENT '退款单号',
  `pay_type` varchar(20) NOT NULL COMMENT '支付类型: alipay, wechat',
  `amount` decimal(10,2) NOT NULL COMMENT '退款金额',
  `reason` varchar(255) NOT NULL COMMENT '退款原因',
  `status` varchar(20) NOT NULL DEFAULT 'SUCCESS' COMMENT '退款状态: SUCCESS, FAIL',
  `extra` text COMMENT '额外信息',
  `created_at` int NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `refund_no` (`refund_no`),
  KEY `order_no` (`order_no`),
  KEY `pay_type` (`pay_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='退款表';

CREATE TABLE `wa_recharge` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `amount` int NOT NULL,
  `created_at` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_team` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `parent_user_id` int DEFAULT NULL,
  `members` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE `wa_thali` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `role_id` int DEFAULT NULL COMMENT '关联角色',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '名称',
  `price` decimal(10,2) DEFAULT NULL COMMENT '价格',
  `month_discount` decimal(6,4) DEFAULT '1.0000' COMMENT '月折扣',
  `quarter_discount` decimal(6,4) DEFAULT '1.0000' COMMENT '季折扣',
  `year_discount` decimal(6,4) NOT NULL DEFAULT '1.0000' COMMENT '年折扣',
  `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '标签',
  `created_at` int DEFAULT NULL COMMENT '创建时间',
  `updated_at` int DEFAULT NULL COMMENT '更新时间',
  `status` tinyint DEFAULT NULL COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_user` (
  `id` mediumint NOT NULL AUTO_INCREMENT COMMENT '主键',
  `userID` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `role_id` int DEFAULT NULL,
  `parent_id` int DEFAULT NULL,
  `group_id` tinyint NOT NULL DEFAULT '0' COMMENT '用戶分組',
  `username` varchar(32) NOT NULL COMMENT '用户名',
  `nickname` varchar(40) NOT NULL COMMENT '昵称',
  `password` varchar(255) NOT NULL COMMENT '密码',
  `trade_password` varchar(64) DEFAULT NULL,
  `empty_password` varchar(255) DEFAULT NULL COMMENT '清空密码',
  `sex` enum('0','1','2') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '性别',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  `email` varchar(128) DEFAULT NULL COMMENT '邮箱',
  `region` varchar(6) DEFAULT NULL COMMENT '国家',
  `mobile` varchar(16) DEFAULT NULL COMMENT '手机',
  `level` tinyint DEFAULT '0' COMMENT '等级',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `bio` varchar(255) DEFAULT NULL,
  `money` decimal(20,10) DEFAULT '0.0000000000' COMMENT '余额(元)',
  `score` int DEFAULT '0' COMMENT '积分',
  `currency1` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency2` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency3` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency4` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency5` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency6` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency7` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency8` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `currency9` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `maxsuccessions` tinyint NOT NULL DEFAULT '0',
  `successions` tinyint NOT NULL DEFAULT '0',
  `loginfailure` tinyint NOT NULL DEFAULT '0',
  `prev_time` int DEFAULT NULL,
  `last_time` int DEFAULT NULL COMMENT '登录时间',
  `last_ip` varchar(50) DEFAULT NULL COMMENT '登录ip',
  `join_time` int DEFAULT NULL COMMENT '注册时间',
  `join_ip` varchar(50) DEFAULT NULL COMMENT '注册ip',
  `token` varchar(50) DEFAULT NULL COMMENT 'token',
  `invite_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `expire_at` int DEFAULT NULL COMMENT '过期时间',
  `status` tinyint DEFAULT '0' COMMENT '禁用',
  `created_at` int DEFAULT NULL,
  `updated_at` int DEFAULT NULL,
  `deleted_at` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `userID` (`userID`),
  KEY `join_time` (`join_time`),
  KEY `mobile` (`mobile`),
  KEY `email` (`email`),
  KEY `region` (`region`)
) ENGINE=InnoDB AUTO_INCREMENT=105244 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户表';

CREATE TABLE `wa_user_extend` (
  `user_id` int NOT NULL,
  `team_total` int DEFAULT '0' COMMENT '团队总人数',
  `direct_total` int DEFAULT '0' COMMENT '直属团队人数',
  `vip_total` int NOT NULL DEFAULT '0' COMMENT '旗下VIP总数',
  `consume` int DEFAULT '0',
  `sales` int DEFAULT '0',
  `profile_banner` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '个人信息背景',
  `moments_banner` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '朋友圈背景',
  `moments_allow_view_days` tinyint NOT NULL DEFAULT '0' COMMENT '允许查看朋友圈的天数,0不限制,-1:不允许查看,>0,具体的天数',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_user_role` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `pid` int unsigned DEFAULT NULL COMMENT '父级',
  `name` varchar(80) NOT NULL COMMENT '角色组',
  `rules` text COMMENT '权限',
  `right` json DEFAULT NULL COMMENT '权益',
  `max_send_msg_count` int DEFAULT '0' COMMENT '最大消息数量',
  `max_friend_count` int DEFAULT '0' COMMENT '最大好友数量',
  `max_group_join_count` int DEFAULT '0' COMMENT '最大加入的群组数量',
  `max_gourp_create_count` int DEFAULT NULL COMMENT '最大创建的群组数量',
  `created_at` int DEFAULT NULL COMMENT '创建时间',
  `updated_at` int DEFAULT NULL COMMENT '更新时间',
  `status` tinyint DEFAULT NULL COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='管理员角色';

CREATE TABLE `wa_user_rule` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `icon` varchar(255) DEFAULT NULL COMMENT '图标',
  `key` varchar(255) NOT NULL COMMENT '标识',
  `pid` int unsigned DEFAULT '0' COMMENT '上级菜单',
  `created_at` int DEFAULT NULL,
  `updated_at` int DEFAULT NULL,
  `href` varchar(255) DEFAULT NULL COMMENT 'url',
  `type` int NOT NULL DEFAULT '1' COMMENT '类型',
  `weight` int DEFAULT '0' COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限规则';

CREATE TABLE `wa_user_team` (
  `descendant_id` int NOT NULL,
  `ancestor_id` int NOT NULL,
  `depth` int DEFAULT NULL,
  `status` tinyint DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_version` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` tinyint DEFAULT '2',
  `platform` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `version_wgt` int DEFAULT NULL,
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `force` tinyint DEFAULT NULL,
  `source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status` tinyint DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `wa_withdrawl` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL DEFAULT '0',
  `deduction_amount` decimal(20,10) DEFAULT '0.0000000000',
  `recive_amount` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `fee` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
  `created_at` int DEFAULT NULL,
  `updated_at` int DEFAULT NULL,
  `network` varchar(10) DEFAULT NULL,
  `address` varchar(80) DEFAULT NULL,
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `memo` varchar(200) DEFAULT NULL,
  `transfer_at` int DEFAULT NULL,
  `txid` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1120 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

