db.sql 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. # ************************************************************
  2. # Sequel Pro SQL dump
  3. # Version 4541
  4. #
  5. # http://www.sequelpro.com/
  6. # https://github.com/sequelpro/sequelpro
  7. #
  8. # Host: 127.0.0.1 (MySQL 5.7.18)
  9. # Database: 2
  10. # Generation Time: 2017-07-29 06:28:10 +0000
  11. # ************************************************************
  12. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  13. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  14. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  15. /*!40101 SET NAMES utf8 */;
  16. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  17. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  18. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  19. # Dump of table ss_node
  20. # ------------------------------------------------------------
  21. CREATE TABLE `ss_node` (
  22. `id` int(11) NOT NULL AUTO_INCREMENT,
  23. `name` varchar(128) NOT NULL DEFAULT '' COMMENT '名称',
  24. `group_id` int(11) NOT NULL DEFAULT '0' COMMENT '所属分组',
  25. `server` varchar(128) NOT NULL DEFAULT '' COMMENT '服务器地址',
  26. `method` varchar(32) NOT NULL DEFAULT 'aes-192-ctr' COMMENT '加密方式',
  27. `custom_method` varchar(30) NOT NULL DEFAULT 'aes-192-ctr' COMMENT '自定义加密方式',
  28. `protocol` varchar(128) NOT NULL DEFAULT 'auth_chain_a' COMMENT '协议',
  29. `protocol_param` varchar(128) DEFAULT '' COMMENT '协议参数',
  30. `obfs` varchar(128) NOT NULL DEFAULT 'tls1.2_ticket_auth' COMMENT '混淆',
  31. `obfs_param` varchar(128) DEFAULT '' COMMENT '混淆参数',
  32. `traffic_rate` float NOT NULL DEFAULT '1' COMMENT '流量比率',
  33. `bandwidth` int(11) NOT NULL DEFAULT '100' COMMENT '出口带宽,单位M',
  34. `traffic` bigint(20) NOT NULL DEFAULT '1000' COMMENT '每月可用流量,单位G',
  35. `monitor_url` varchar(255) DEFAULT NULL COMMENT '监控地址',
  36. `compatible` tinyint(4) DEFAULT '0' COMMENT '兼容SS',
  37. `sort` int(3) NOT NULL DEFAULT '0' COMMENT '排序值,值越大越靠前显示',
  38. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:0-维护、1-正常',
  39. `created_at` datetime NOT NULL,
  40. `updated_at` datetime NOT NULL,
  41. PRIMARY KEY (`id`)
  42. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='节点信息表';
  43. # Dump of table ss_node_info
  44. # ------------------------------------------------------------
  45. CREATE TABLE `ss_node_info` (
  46. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  47. `node_id` int(11) NOT NULL DEFAULT '0' COMMENT '节点ID',
  48. `uptime` float NOT NULL COMMENT '更新时间',
  49. `load` varchar(32) NOT NULL COMMENT '负载',
  50. `log_time` int(11) NOT NULL COMMENT '记录时间',
  51. `created_at` datetime NOT NULL,
  52. `updated_at` datetime NOT NULL,
  53. PRIMARY KEY (`id`)
  54. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='节点负载信息';
  55. # Dump of table ss_node_online_log
  56. # ------------------------------------------------------------
  57. CREATE TABLE `ss_node_online_log` (
  58. `id` int(11) NOT NULL AUTO_INCREMENT,
  59. `node_id` int(11) NOT NULL COMMENT '节点ID',
  60. `online_user` int(11) NOT NULL COMMENT '在线用户数',
  61. `log_time` int(11) NOT NULL COMMENT '记录时间',
  62. `created_at` datetime NOT NULL,
  63. `updated_at` datetime NOT NULL,
  64. PRIMARY KEY (`id`)
  65. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='节点在线信息';
  66. # Dump of table user
  67. # ------------------------------------------------------------
  68. CREATE TABLE `user` (
  69. `id` int(11) NOT NULL AUTO_INCREMENT,
  70. `username` varchar(128) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' COMMENT '用户名',
  71. `password` varchar(64) NOT NULL DEFAULT '' COMMENT '密码',
  72. `port` int(11) NOT NULL DEFAULT '0' COMMENT 'SS端口',
  73. `passwd` varchar(16) NOT NULL DEFAULT '' COMMENT 'SS密码',
  74. `transfer_enable` bigint(20) NOT NULL DEFAULT '1073741824000' COMMENT '可用流量,单位字节,默认1TiB',
  75. `u` bigint(20) NOT NULL DEFAULT '0' COMMENT '已上传流量,单位字节',
  76. `d` bigint(20) NOT NULL DEFAULT '0' COMMENT '已下载流量,单位字节',
  77. `t` int(11) NOT NULL DEFAULT '0' COMMENT '最后使用时间',
  78. `enable` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'SS状态',
  79. `method` varchar(30) NOT NULL DEFAULT 'aes-192-ctr' COMMENT '加密方式',
  80. `custom_method` varchar(30) DEFAULT 'aes-192-ctr' COMMENT '自定义加密方式',
  81. `protocol` varchar(30) NOT NULL DEFAULT 'auth_chain_a' COMMENT '协议',
  82. `protocol_param` varchar(255) DEFAULT '' COMMENT '协议参数',
  83. `obfs` varchar(30) NOT NULL DEFAULT 'tls1.2_ticket_auth' COMMENT '混淆',
  84. `obfs_param` varchar(255) DEFAULT '' COMMENT '混淆参数',
  85. `speed_limit_per_con` int(255) NOT NULL DEFAULT '204800' COMMENT '单连接限速,默认200M,单位KB',
  86. `speed_limit_per_user` int(255) NOT NULL DEFAULT '204800' COMMENT '单用户限速,默认200M,单位KB',
  87. `wechat` varchar(30) DEFAULT '' COMMENT '微信',
  88. `qq` varchar(20) DEFAULT '' COMMENT 'QQ',
  89. `usage` tinyint(4) NOT NULL DEFAULT '4' COMMENT '用途:1-手机、2-电脑、3-路由器、4-其他',
  90. `pay_way` tinyint(4) NOT NULL DEFAULT '0' COMMENT '付费方式:0-免费、1-月付、2-半年付、3-年付',
  91. `balance` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '余额',
  92. `score` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
  93. `enable_time` date DEFAULT NULL COMMENT '开通日期',
  94. `expire_time` date NOT NULL DEFAULT '2099-01-01' COMMENT '过期时间',
  95. `remark` text COMMENT '备注',
  96. `level` tinyint(4) NOT NULL DEFAULT '1' COMMENT '等级:1-倔强青铜、2-秩序白银、3-荣耀黄金、4-尊贵铂金、5-永恒钻石、6-至尊黑曜、7-最强王者',
  97. `is_admin` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否管理员:0-否、1-是',
  98. `reg_ip` varchar(20) NOT NULL DEFAULT '127.0.0.1' COMMENT '注册IP',
  99. `last_login` int(11) NOT NULL DEFAULT '0' COMMENT '最后一次登录时间',
  100. `referral_uid` int(11) NOT NULL DEFAULT '0' COMMENT '邀请人',
  101. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:-1-禁用、0-未激活、1-正常',
  102. `created_at` datetime DEFAULT NULL,
  103. `updated_at` datetime DEFAULT NULL,
  104. PRIMARY KEY (`id`),
  105. UNIQUE KEY `port` (`port`)
  106. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  107. LOCK TABLES `user` WRITE;
  108. /*!40000 ALTER TABLE `user` DISABLE KEYS */;
  109. INSERT INTO `user` (`id`, `username`, `password`, `port`, `passwd`, `transfer_enable`, `u`, `d`, `t`, `enable`, `method`, `custom_method`, `protocol`, `protocol_param`, `obfs`, `obfs_param`, `speed_limit_per_con`, `speed_limit_per_user`, `wechat`, `qq`, `usage`, `pay_way`, `balance`, `enable_time`, `expire_time`, `remark`, `is_admin`, `reg_ip`, `created_at`, `updated_at`)
  110. VALUES (1,'admin','e10adc3949ba59abbe56e057f20f883e',10000,'@123',1073741824000,0,0,0,1,'aes-192-ctr','aes-192-ctr','auth_chain_a','','tls1.2_ticket_auth','',204800,204800,'','',1,3,0.00,NULL,'2099-01-01',NULL,1,'127.0.0.1',NULL,NULL);
  111. /*!40000 ALTER TABLE `user` ENABLE KEYS */;
  112. UNLOCK TABLES;
  113. -- ----------------------------
  114. -- Table structure for `user_traffic_log`
  115. -- ----------------------------
  116. CREATE TABLE `user_traffic_log` (
  117. `id` int(11) NOT NULL AUTO_INCREMENT,
  118. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  119. `u` int(11) NOT NULL DEFAULT '0' COMMENT '上传流量',
  120. `d` int(11) NOT NULL DEFAULT '0' COMMENT '下载流量',
  121. `node_id` int(11) NOT NULL DEFAULT '0' COMMENT '节点ID',
  122. `rate` float NOT NULL COMMENT '流量比例',
  123. `traffic` varchar(32) NOT NULL COMMENT '产生流量',
  124. `log_time` int(11) NOT NULL COMMENT '记录时间',
  125. PRIMARY KEY (`id`),
  126. KEY `idx_user` (`user_id`),
  127. KEY `idx_node` (`node_id`)
  128. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  129. -- ----------------------------
  130. -- Table structure for `ss_config`
  131. -- ----------------------------
  132. DROP TABLE IF EXISTS `ss_config`;
  133. CREATE TABLE `ss_config` (
  134. `id` int(11) NOT NULL AUTO_INCREMENT,
  135. `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '配置名',
  136. `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型:1-加密方式、2-协议、3-混淆',
  137. `is_default` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否默认:0-不是、1-是',
  138. `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序:值越大排越前',
  139. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  140. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  141. PRIMARY KEY (`id`)
  142. ) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  143. -- ----------------------------
  144. -- Records of ss_config
  145. -- ----------------------------
  146. INSERT INTO `ss_config` VALUES ('1', 'none', '1', '0', '0', '2017-08-01 13:12:23', '2017-08-01 13:12:23');
  147. INSERT INTO `ss_config` VALUES ('2', 'rc4-md5', '1', '0', '0', '2017-08-01 13:12:29', '2017-08-01 13:12:29');
  148. INSERT INTO `ss_config` VALUES ('3', 'bf-cfb', '1', '0', '0', '2017-08-01 13:13:05', '2017-08-01 13:13:05');
  149. INSERT INTO `ss_config` VALUES ('4', 'aes-128-cfb', '1', '0', '0', '2017-08-01 13:13:13', '2017-08-01 13:13:13');
  150. INSERT INTO `ss_config` VALUES ('5', 'aes-192-cfb', '1', '0', '0', '2017-08-01 13:13:25', '2017-08-01 13:13:25');
  151. INSERT INTO `ss_config` VALUES ('6', 'aes-256-cfb', '1', '0', '0', '2017-08-01 13:13:39', '2017-08-01 13:13:39');
  152. INSERT INTO `ss_config` VALUES ('7', 'aes-128-ctr', '1', '0', '0', '2017-08-01 13:13:46', '2017-08-01 13:13:46');
  153. INSERT INTO `ss_config` VALUES ('8', 'aes-192-ctr', '1', '1', '0', '2017-08-01 13:13:53', '2017-08-01 13:13:53');
  154. INSERT INTO `ss_config` VALUES ('9', 'aes-256-ctr', '1', '0', '0', '2017-08-01 13:14:00', '2017-08-01 13:14:00');
  155. INSERT INTO `ss_config` VALUES ('10', 'camellia-128-cfb', '1', '0', '0', '2017-08-01 13:14:08', '2017-08-01 13:14:08');
  156. INSERT INTO `ss_config` VALUES ('11', 'camellia-192-cfb', '1', '0', '0', '2017-08-01 13:14:12', '2017-08-01 13:14:12');
  157. INSERT INTO `ss_config` VALUES ('12', 'camellia-256-cfb', '1', '0', '0', '2017-08-01 13:14:51', '2017-08-01 13:14:51');
  158. INSERT INTO `ss_config` VALUES ('13', 'salsa20', '1', '0', '0', '2017-08-01 13:15:09', '2017-08-01 13:15:09');
  159. INSERT INTO `ss_config` VALUES ('14', 'chacha20', '1', '0', '0', '2017-08-01 13:15:16', '2017-08-01 13:15:16');
  160. INSERT INTO `ss_config` VALUES ('15', 'chacha20-ietf', '1', '0', '0', '2017-08-01 13:15:27', '2017-08-01 13:15:27');
  161. INSERT INTO `ss_config` VALUES ('16', 'chacha20-ietf-poly1305', '1', '0', '0', '2017-08-01 13:15:39', '2017-08-01 13:15:39');
  162. INSERT INTO `ss_config` VALUES ('17', 'chacha20-poly1305', '1', '0', '0', '2017-08-01 13:15:46', '2017-08-01 13:15:46');
  163. INSERT INTO `ss_config` VALUES ('18', 'xchacha-ietf-poly1305', '1', '0', '0', '2017-08-01 13:21:51', '2017-08-01 13:21:51');
  164. INSERT INTO `ss_config` VALUES ('19', 'aes-128-gcm', '1', '0', '0', '2017-08-01 13:22:05', '2017-08-01 13:22:05');
  165. INSERT INTO `ss_config` VALUES ('20', 'aes-192-gcm', '1', '0', '0', '2017-08-01 13:22:12', '2017-08-01 13:22:12');
  166. INSERT INTO `ss_config` VALUES ('21', 'aes-256-gcm', '1', '0', '0', '2017-08-01 13:22:19', '2017-08-01 13:22:19');
  167. INSERT INTO `ss_config` VALUES ('22', 'sodium-aes-256-gcm', '1', '0', '0', '2017-08-01 13:22:32', '2017-08-01 13:22:32');
  168. INSERT INTO `ss_config` VALUES ('23', 'origin', '2', '0', '0', '2017-08-01 13:23:57', '2017-08-01 13:23:57');
  169. INSERT INTO `ss_config` VALUES ('24', 'auth_sha1_v4', '2', '0', '0', '2017-08-01 13:24:41', '2017-08-01 13:24:41');
  170. INSERT INTO `ss_config` VALUES ('25', 'auth_aes128_md5', '2', '0', '0', '2017-08-01 13:24:58', '2017-08-01 13:24:58');
  171. INSERT INTO `ss_config` VALUES ('26', 'auth_aes128_sha1', '2', '0', '0', '2017-08-01 13:25:11', '2017-08-01 13:25:11');
  172. INSERT INTO `ss_config` VALUES ('27', 'auth_chain_a', '2', '1', '0', '2017-08-01 13:25:24', '2017-08-01 13:25:24');
  173. INSERT INTO `ss_config` VALUES ('28', 'auth_chain_b', '2', '0', '0', '2017-08-01 14:02:31', '2017-08-01 14:02:31');
  174. INSERT INTO `ss_config` VALUES ('29', 'plain', '3', '0', '0', '2017-08-01 13:29:14', '2017-08-01 13:29:14');
  175. INSERT INTO `ss_config` VALUES ('30', 'http_simple', '3', '0', '0', '2017-08-01 13:29:30', '2017-08-01 13:29:30');
  176. INSERT INTO `ss_config` VALUES ('31', 'http_post', '3', '0', '0', '2017-08-01 13:29:38', '2017-08-01 13:29:38');
  177. INSERT INTO `ss_config` VALUES ('32', 'tls1.2_ticket_auth', '3', '1', '0', '2017-08-01 13:29:51', '2017-08-01 13:29:51');
  178. INSERT INTO `ss_config` VALUES ('33', 'tls1.2_ticket_fastauth', '3', '0', '0', '2017-08-01 14:02:19', '2017-08-01 14:02:19');
  179. -- ----------------------------
  180. -- Table structure for `config`
  181. -- ----------------------------
  182. CREATE TABLE `config` (
  183. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  184. `name` varchar(255) NOT NULL DEFAULT '' COMMENT '配置名',
  185. `value` varchar(255) NOT NULL DEFAULT '' COMMENT '配置值',
  186. PRIMARY KEY (`id`)
  187. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='系统配置';
  188. -- ----------------------------
  189. -- Records of config
  190. -- ----------------------------
  191. INSERT INTO `config` VALUES ('1', 'is_rand_port', 0);
  192. INSERT INTO `config` VALUES ('2', 'is_user_rand_port', 0);
  193. INSERT INTO `config` VALUES ('3', 'invite_num', 3);
  194. INSERT INTO `config` VALUES ('4', 'is_register', 1);
  195. INSERT INTO `config` VALUES ('5', 'is_invite_register', 1);
  196. INSERT INTO `config` VALUES ('6', 'website_name', 'SSRPanel');
  197. INSERT INTO `config` VALUES ('7', 'is_reset_password', 1);
  198. INSERT INTO `config` VALUES ('8', 'reset_password_times', 3);
  199. INSERT INTO `config` VALUES ('9', 'website_url', 'http://baidu.com');
  200. INSERT INTO `config` VALUES ('10', 'is_active_register', 1);
  201. INSERT INTO `config` VALUES ('11', 'active_times', 3);
  202. INSERT INTO `config` VALUES ('12', 'login_add_score', 1);
  203. INSERT INTO `config` VALUES ('13', 'min_rand_score', 1);
  204. INSERT INTO `config` VALUES ('14', 'max_rand_score', 100);
  205. INSERT INTO `config` VALUES ('15', 'wechat_qrcode', '');
  206. INSERT INTO `config` VALUES ('16', 'alipay_qrcode', '');
  207. INSERT INTO `config` VALUES ('17', 'login_add_score_range', 1440);
  208. INSERT INTO `config` VALUES ('18', 'referral_traffic', 1024);
  209. INSERT INTO `config` VALUES ('19', 'referral_percent', 0.2);
  210. INSERT INTO `config` VALUES ('20', 'referral_money', 100);
  211. INSERT INTO `config` VALUES ('21', 'referral_status', 1);
  212. INSERT INTO `config` VALUES ('22', 'default_traffic', 1024);
  213. INSERT INTO `config` VALUES ('23', 'traffic_warning', 0);
  214. INSERT INTO `config` VALUES ('24', 'traffic_warning_percent', 80);
  215. INSERT INTO `config` VALUES ('25', 'expire_warning', 0);
  216. INSERT INTO `config` VALUES ('26', 'expire_days', 15);
  217. INSERT INTO `config` VALUES ('27', 'reset_traffic', 1);
  218. INSERT INTO `config` VALUES ('28', 'default_days', 7);
  219. -- ----------------------------
  220. -- Table structure for `article`
  221. -- ----------------------------
  222. CREATE TABLE `article` (
  223. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  224. `title` varchar(100) NOT NULL DEFAULT '' COMMENT '文章标题',
  225. `content` text COMMENT '文章内容',
  226. `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除',
  227. `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
  228. `created_at` datetime DEFAULT NULL,
  229. `updated_at` datetime DEFAULT NULL,
  230. PRIMARY KEY (`id`)
  231. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='文章表';
  232. -- ----------------------------
  233. -- Table structure for `invite`
  234. -- ----------------------------
  235. CREATE TABLE `invite` (
  236. `id` int(11) NOT NULL AUTO_INCREMENT,
  237. `uid` int(11) NOT NULL DEFAULT '0' COMMENT '邀请人ID',
  238. `fuid` int(11) NOT NULL DEFAULT '0' COMMENT '受邀人ID',
  239. `code` char(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邀请码',
  240. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '邀请码状态:0-未使用、1-已使用、2-已过期',
  241. `dateline` datetime DEFAULT NULL COMMENT '有效期至',
  242. `created_at` datetime DEFAULT NULL,
  243. `updated_at` datetime DEFAULT NULL,
  244. PRIMARY KEY (`id`)
  245. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邀请码表';
  246. -- ----------------------------
  247. -- Table structure for `verify`
  248. -- ----------------------------
  249. CREATE TABLE `verify` (
  250. `id` int(11) NOT NULL AUTO_INCREMENT,
  251. `user_id` int(11) NOT NULL COMMENT '用户ID',
  252. `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
  253. `token` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '校验token',
  254. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效',
  255. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  256. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  257. PRIMARY KEY (`id`)
  258. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  259. -- ----------------------------
  260. -- Table structure for `ss_group`
  261. -- ----------------------------
  262. CREATE TABLE `ss_group` (
  263. `id` int(11) NOT NULL AUTO_INCREMENT,
  264. `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分组名称',
  265. `level` tinyint(4) NOT NULL DEFAULT '1' COMMENT '分组级别,对应账号级别',
  266. `created_at` datetime DEFAULT NULL,
  267. `updated_at` datetime DEFAULT NULL,
  268. PRIMARY KEY (`id`)
  269. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  270. -- ----------------------------
  271. -- Table structure for `ss_group_node`
  272. -- ----------------------------
  273. CREATE TABLE `ss_group_node` (
  274. `id` int(11) NOT NULL AUTO_INCREMENT,
  275. `group_id` int(11) NOT NULL DEFAULT '0' COMMENT '分组ID',
  276. `node_id` int(11) NOT NULL DEFAULT '0' COMMENT '节点ID',
  277. PRIMARY KEY (`id`)
  278. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='分组节点关系表';
  279. -- ----------------------------
  280. -- Table structure for `goods`
  281. -- ----------------------------
  282. CREATE TABLE `goods` (
  283. `id` int(11) NOT NULL AUTO_INCREMENT,
  284. `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品名称',
  285. `logo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品图片地址',
  286. `traffic` bigint(20) NOT NULL DEFAULT '0' COMMENT '商品内含多少流量,单位Mib',
  287. `score` int(11) NOT NULL DEFAULT '0' COMMENT '商品价值多少积分',
  288. `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '商品类型:1-流量包、2-套餐',
  289. `price` int(11) NOT NULL DEFAULT '0' COMMENT '商品售价,单位分',
  290. `desc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '商品描述',
  291. `days` int(11) NOT NULL DEFAULT '30' COMMENT '有效期',
  292. `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否已删除:0-否、1-是',
  293. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:0-下架、1-上架',
  294. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  295. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  296. PRIMARY KEY (`id`)
  297. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='商品信息表';
  298. -- ----------------------------
  299. -- Table structure for `coupon`
  300. -- ----------------------------
  301. CREATE TABLE `coupon` (
  302. `id` int(11) NOT NULL AUTO_INCREMENT,
  303. `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '优惠券名称',
  304. `logo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '优惠券LOGO',
  305. `sn` char(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '优惠券码',
  306. `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型:1-现金优惠、2-折扣优惠',
  307. `usage` tinyint(4) NOT NULL DEFAULT '1' COMMENT '用途:1-仅限一次性使用、2-可重复使用',
  308. `amount` int(11) NOT NULL DEFAULT '0' COMMENT '金额,单位分',
  309. `discount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '折扣',
  310. `available_start` int(11) NOT NULL DEFAULT '0' COMMENT '有效期开始',
  311. `available_end` int(11) NOT NULL DEFAULT '0' COMMENT '有效期结束',
  312. `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否已删除:0-未删除、1-已删除',
  313. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:0-未使用、1-已使用、2-已失效',
  314. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  315. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  316. PRIMARY KEY (`id`)
  317. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='优惠券';
  318. -- ----------------------------
  319. -- Table structure for `coupon_log`
  320. -- ----------------------------
  321. CREATE TABLE `coupon_log` (
  322. `id` int(11) NOT NULL AUTO_INCREMENT,
  323. `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券ID',
  324. `goods_id` int(11) NOT NULL COMMENT '商品ID',
  325. `order_id` int(11) NOT NULL COMMENT '订单ID',
  326. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  327. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  328. PRIMARY KEY (`id`)
  329. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='优惠券使用日志';
  330. -- ----------------------------
  331. -- Table structure for `order`
  332. -- ----------------------------
  333. CREATE TABLE `order` (
  334. `oid` int(11) NOT NULL AUTO_INCREMENT,
  335. `orderId` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '订单编号',
  336. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '操作人',
  337. `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券ID',
  338. `totalOriginalPrice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单原始总价',
  339. `totalPrice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单总价',
  340. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成',
  341. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  342. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  343. PRIMARY KEY (`oid`)
  344. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单信息表';
  345. -- ----------------------------
  346. -- Table structure for `order_goods`
  347. -- ----------------------------
  348. CREATE TABLE `order_goods` (
  349. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  350. `oid` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID',
  351. `orderId` varchar(20) NOT NULL DEFAULT '' COMMENT '订单编号',
  352. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  353. `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品ID',
  354. `num` int(11) NOT NULL DEFAULT '0' COMMENT '商品数量',
  355. `original_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品原价',
  356. `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品实际价格',
  357. `is_expire` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否已过期:0-未过期、1-已过期',
  358. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  359. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  360. PRIMARY KEY (`id`)
  361. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  362. -- ----------------------------
  363. -- Table structure for `ticket`
  364. -- ----------------------------
  365. CREATE TABLE `ticket` (
  366. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  367. `user_id` int(11) NOT NULL DEFAULT '0',
  368. `title` varchar(255) NOT NULL DEFAULT '' COMMENT '标题',
  369. `content` text NOT NULL COMMENT '内容',
  370. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:0-待处理、1-已处理未关闭、2-已关闭',
  371. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  372. PRIMARY KEY (`id`)
  373. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  374. -- ----------------------------
  375. -- Table structure for `ticket_reply`
  376. -- ----------------------------
  377. CREATE TABLE `ticket_reply` (
  378. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  379. `ticket_id` int(11) NOT NULL DEFAULT '0' COMMENT '工单ID',
  380. `user_id` int(11) NOT NULL COMMENT '回复人ID',
  381. `content` text NOT NULL COMMENT '回复内容',
  382. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  383. PRIMARY KEY (`id`)
  384. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  385. -- ----------------------------
  386. -- Table structure for `user_score_log`
  387. -- ----------------------------
  388. CREATE TABLE `user_score_log` (
  389. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  390. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '账号ID',
  391. `before` int(11) NOT NULL DEFAULT '0' COMMENT '发生前积分',
  392. `after` int(11) NOT NULL DEFAULT '0' COMMENT '发生后积分',
  393. `score` int(11) NOT NULL DEFAULT '0' COMMENT '发生积分',
  394. `desc` varchar(50) DEFAULT '' COMMENT '描述',
  395. `created_at` datetime DEFAULT NULL COMMENT '创建日期',
  396. PRIMARY KEY (`id`),
  397. KEY `idx` (`user_id`) USING BTREE
  398. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
  399. -- ----------------------------
  400. -- Table structure for `user_balance_log`
  401. -- ----------------------------
  402. CREATE TABLE `user_balance_log` (
  403. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  404. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '账号ID',
  405. `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID',
  406. `before` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '发生前余额',
  407. `after` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '发生后余额',
  408. `balance` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '发生金额',
  409. `desc` varchar(255) DEFAULT '' COMMENT '描述',
  410. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  411. PRIMARY KEY (`id`)
  412. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  413. -- ----------------------------
  414. -- Table structure for `referral_apply`
  415. -- ----------------------------
  416. CREATE TABLE `referral_apply` (
  417. `id` int(11) NOT NULL AUTO_INCREMENT,
  418. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  419. `before` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '操作前可提现金额',
  420. `after` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '操作后可提现金额',
  421. `amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '本次提现金额',
  422. `link_logs` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '关联返利日志ID,例如:1,3,4',
  423. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:-1-驳回、0-待审核、1-审核通过待打款、2-已打款',
  424. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  425. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  426. PRIMARY KEY (`id`)
  427. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='提现申请';
  428. -- ----------------------------
  429. -- Table structure for `referral_log`
  430. -- ----------------------------
  431. CREATE TABLE `referral_log` (
  432. `id` int(11) NOT NULL AUTO_INCREMENT,
  433. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  434. `ref_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '推广人ID',
  435. `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联订单ID',
  436. `amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '消费金额',
  437. `ref_amount` int(11) NOT NULL DEFAULT '0' COMMENT '返利金额',
  438. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:0-未提现、1-审核中、2-已提现',
  439. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  440. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  441. PRIMARY KEY (`id`)
  442. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='消费返利日志';
  443. -- ----------------------------
  444. -- Table structure for `email_log`
  445. -- ----------------------------
  446. CREATE TABLE `email_log` (
  447. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  448. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '接收者ID',
  449. `title` varchar(255) DEFAULT '' COMMENT '邮件标题',
  450. `content` text COMMENT '邮件内容',
  451. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:1-发送成功、2-发送失败',
  452. `error` text COMMENT '发送失败抛出的异常信息',
  453. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  454. PRIMARY KEY (`id`)
  455. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邮件投递记录';
  456. -- ----------------------------
  457. -- Table structure for `user_subscribe`
  458. -- ----------------------------
  459. CREATE TABLE `user_subscribe` (
  460. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  461. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  462. `code` varchar(255) DEFAULT '' COMMENT '订阅地址唯一识别码',
  463. `times` int(11) NOT NULL DEFAULT '0' COMMENT '地址请求次数',
  464. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  465. PRIMARY KEY (`id`)
  466. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  467. -- ----------------------------
  468. -- Table structure for `user_subscribe_log`
  469. -- ----------------------------
  470. CREATE TABLE `user_subscribe_log` (
  471. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  472. `sid` int(11) DEFAULT NULL COMMENT '对应user_subscribe的id',
  473. `request_ip` varchar(20) DEFAULT NULL COMMENT '请求IP',
  474. `request_time` datetime DEFAULT NULL COMMENT '请求时间',
  475. PRIMARY KEY (`id`)
  476. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  477. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  478. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  479. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  480. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  481. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  482. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;