db.sql 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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. -- ----------------------------
  218. -- Table structure for `article`
  219. -- ----------------------------
  220. CREATE TABLE `article` (
  221. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  222. `title` varchar(100) NOT NULL DEFAULT '' COMMENT '文章标题',
  223. `content` text COMMENT '文章内容',
  224. `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除',
  225. `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
  226. `created_at` datetime DEFAULT NULL,
  227. `updated_at` datetime DEFAULT NULL,
  228. PRIMARY KEY (`id`)
  229. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='文章表';
  230. -- ----------------------------
  231. -- Table structure for `invite`
  232. -- ----------------------------
  233. CREATE TABLE `invite` (
  234. `id` int(11) NOT NULL AUTO_INCREMENT,
  235. `uid` int(11) NOT NULL DEFAULT '0' COMMENT '邀请人ID',
  236. `fuid` int(11) NOT NULL DEFAULT '0' COMMENT '受邀人ID',
  237. `code` char(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邀请码',
  238. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '邀请码状态:0-未使用、1-已使用、2-已过期',
  239. `dateline` datetime DEFAULT NULL COMMENT '有效期至',
  240. `created_at` datetime DEFAULT NULL,
  241. `updated_at` datetime DEFAULT NULL,
  242. PRIMARY KEY (`id`)
  243. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邀请码表';
  244. -- ----------------------------
  245. -- Table structure for `verify`
  246. -- ----------------------------
  247. CREATE TABLE `verify` (
  248. `id` int(11) NOT NULL AUTO_INCREMENT,
  249. `user_id` int(11) NOT NULL COMMENT '用户ID',
  250. `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
  251. `token` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '校验token',
  252. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效',
  253. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  254. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  255. PRIMARY KEY (`id`)
  256. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  257. -- ----------------------------
  258. -- Table structure for `ss_group`
  259. -- ----------------------------
  260. CREATE TABLE `ss_group` (
  261. `id` int(11) NOT NULL AUTO_INCREMENT,
  262. `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分组名称',
  263. `level` tinyint(4) NOT NULL DEFAULT '1' COMMENT '分组级别,对应账号级别',
  264. `created_at` datetime DEFAULT NULL,
  265. `updated_at` datetime DEFAULT NULL,
  266. PRIMARY KEY (`id`)
  267. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  268. -- ----------------------------
  269. -- Table structure for `ss_group_node`
  270. -- ----------------------------
  271. CREATE TABLE `ss_group_node` (
  272. `id` int(11) NOT NULL AUTO_INCREMENT,
  273. `group_id` int(11) NOT NULL DEFAULT '0' COMMENT '分组ID',
  274. `node_id` int(11) NOT NULL DEFAULT '0' COMMENT '节点ID',
  275. PRIMARY KEY (`id`)
  276. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='分组节点关系表';
  277. -- ----------------------------
  278. -- Table structure for `goods`
  279. -- ----------------------------
  280. CREATE TABLE `goods` (
  281. `id` int(11) NOT NULL AUTO_INCREMENT,
  282. `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品名称',
  283. `logo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品图片地址',
  284. `traffic` bigint(20) NOT NULL DEFAULT '0' COMMENT '商品内含多少流量,单位MiB',
  285. `score` int(11) NOT NULL DEFAULT '0' COMMENT '商品价值多少积分',
  286. `price` int(11) NOT NULL DEFAULT '0' COMMENT '商品售价,单位分',
  287. `desc` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '商品描述',
  288. `start_time` datetime DEFAULT NULL COMMENT '有效期开始',
  289. `end_time` datetime DEFAULT NULL COMMENT '有效期结束',
  290. `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否已删除:0-否、1-是',
  291. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:0-下架、1-上架',
  292. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  293. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  294. PRIMARY KEY (`id`)
  295. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='商品信息表';
  296. -- ----------------------------
  297. -- Table structure for `coupon`
  298. -- ----------------------------
  299. CREATE TABLE `coupon` (
  300. `id` int(11) NOT NULL AUTO_INCREMENT,
  301. `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '优惠券名称',
  302. `logo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '优惠券LOGO',
  303. `sn` char(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '优惠券码',
  304. `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型:1-现金优惠、2-折扣优惠',
  305. `usage` tinyint(4) NOT NULL DEFAULT '1' COMMENT '用途:1-仅限一次性使用、2-可重复使用',
  306. `amount` int(11) NOT NULL DEFAULT '0' COMMENT '金额,单位分',
  307. `discount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '折扣',
  308. `available_start` int(11) NOT NULL DEFAULT '0' COMMENT '有效期开始',
  309. `available_end` int(11) NOT NULL DEFAULT '0' COMMENT '有效期结束',
  310. `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否已删除:0-未删除、1-已删除',
  311. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:0-未使用、1-已使用、2-已失效',
  312. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  313. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  314. PRIMARY KEY (`id`)
  315. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='优惠券';
  316. -- ----------------------------
  317. -- Table structure for `coupon_log`
  318. -- ----------------------------
  319. CREATE TABLE `coupon_log` (
  320. `id` int(11) NOT NULL AUTO_INCREMENT,
  321. `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券ID',
  322. `goods_id` int(11) NOT NULL COMMENT '商品ID',
  323. `order_id` int(11) NOT NULL COMMENT '订单ID',
  324. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  325. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  326. PRIMARY KEY (`id`)
  327. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='优惠券使用日志';
  328. -- ----------------------------
  329. -- Table structure for `order`
  330. -- ----------------------------
  331. CREATE TABLE `order` (
  332. `oid` int(11) NOT NULL AUTO_INCREMENT,
  333. `orderId` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '订单编号',
  334. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '操作人',
  335. `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券ID',
  336. `totalOriginalPrice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单原始总价',
  337. `totalPrice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单总价',
  338. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成',
  339. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  340. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  341. PRIMARY KEY (`oid`)
  342. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单信息表';
  343. -- ----------------------------
  344. -- Table structure for `order_goods`
  345. -- ----------------------------
  346. CREATE TABLE `order_goods` (
  347. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  348. `oid` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID',
  349. `orderId` varchar(20) NOT NULL DEFAULT '' COMMENT '订单编号',
  350. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  351. `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品ID',
  352. `num` int(11) NOT NULL DEFAULT '0' COMMENT '商品数量',
  353. `original_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品原价',
  354. `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品实际价格',
  355. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  356. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  357. PRIMARY KEY (`id`)
  358. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  359. -- ----------------------------
  360. -- Table structure for `ticket`
  361. -- ----------------------------
  362. CREATE TABLE `ticket` (
  363. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  364. `user_id` int(11) NOT NULL DEFAULT '0',
  365. `title` varchar(255) NOT NULL DEFAULT '' COMMENT '标题',
  366. `content` text NOT NULL COMMENT '内容',
  367. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:0-待处理、1-已处理未关闭、2-已关闭',
  368. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  369. PRIMARY KEY (`id`)
  370. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  371. -- ----------------------------
  372. -- Table structure for `ticket_reply`
  373. -- ----------------------------
  374. CREATE TABLE `ticket_reply` (
  375. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  376. `ticket_id` int(11) NOT NULL DEFAULT '0' COMMENT '工单ID',
  377. `user_id` int(11) NOT NULL COMMENT '回复人ID',
  378. `content` text NOT NULL COMMENT '回复内容',
  379. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  380. PRIMARY KEY (`id`)
  381. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  382. -- ----------------------------
  383. -- Table structure for `user_score_log`
  384. -- ----------------------------
  385. CREATE TABLE `user_score_log` (
  386. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  387. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '账号ID',
  388. `before` int(11) NOT NULL DEFAULT '0' COMMENT '发生前积分',
  389. `after` int(11) NOT NULL DEFAULT '0' COMMENT '发生后积分',
  390. `score` int(11) NOT NULL DEFAULT '0' COMMENT '发生积分',
  391. `desc` varchar(50) DEFAULT '' COMMENT '描述',
  392. `created_at` datetime DEFAULT NULL COMMENT '创建日期',
  393. PRIMARY KEY (`id`),
  394. KEY `idx` (`user_id`) USING BTREE
  395. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
  396. -- ----------------------------
  397. -- Table structure for `user_balance_log`
  398. -- ----------------------------
  399. CREATE TABLE `user_balance_log` (
  400. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  401. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '账号ID',
  402. `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID',
  403. `before` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '发生前余额',
  404. `after` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '发生后余额',
  405. `balance` decimal(11,2) NOT NULL DEFAULT '0.00' COMMENT '发生金额',
  406. `desc` varchar(255) DEFAULT '' COMMENT '描述',
  407. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  408. PRIMARY KEY (`id`)
  409. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  410. -- ----------------------------
  411. -- Table structure for `referral_apply`
  412. -- ----------------------------
  413. CREATE TABLE `referral_apply` (
  414. `id` int(11) NOT NULL AUTO_INCREMENT,
  415. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  416. `before` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '操作前可提现金额',
  417. `after` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '操作后可提现金额',
  418. `amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '本次提现金额',
  419. `link_logs` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '关联返利日志ID,例如:1,3,4',
  420. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:-1-驳回、0-待审核、1-审核通过待打款、2-已打款',
  421. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  422. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  423. PRIMARY KEY (`id`)
  424. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='提现申请';
  425. -- ----------------------------
  426. -- Table structure for `referral_log`
  427. -- ----------------------------
  428. CREATE TABLE `referral_log` (
  429. `id` int(11) NOT NULL AUTO_INCREMENT,
  430. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
  431. `ref_user_id` int(11) NOT NULL DEFAULT '0' COMMENT '推广人ID',
  432. `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联订单ID',
  433. `amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '消费金额',
  434. `ref_amount` int(11) NOT NULL DEFAULT '0' COMMENT '返利金额',
  435. `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态:0-未提现、1-审核中、2-已提现',
  436. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  437. `updated_at` datetime DEFAULT NULL COMMENT '最后一次更新时间',
  438. PRIMARY KEY (`id`)
  439. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='消费返利日志';
  440. -- ----------------------------
  441. -- Table structure for `email_log`
  442. -- ----------------------------
  443. CREATE TABLE `email_log` (
  444. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  445. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '接收者ID',
  446. `title` varchar(255) DEFAULT '' COMMENT '邮件标题',
  447. `content` text COMMENT '邮件内容',
  448. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态:1-发送成功、2-发送失败',
  449. `error` text COMMENT '发送失败抛出的异常信息',
  450. `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  451. PRIMARY KEY (`id`)
  452. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邮件投递记录';
  453. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  454. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  455. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  456. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  457. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  458. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;