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='用户表';
