V1.0.sql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. CREATE TABLE `privatedomain`.`user` (
  2. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  3. `open_id` varchar(32) NOT NULL COMMENT '微信openid',
  4. `phone` varchar(16) NOT NULL COMMENT '手机号',
  5. `nick_name` varchar(32) NOT NULL COMMENT '昵称',
  6. `create_time` timestamp(0) NULL COMMENT '创建时间',
  7. `login_time` timestamp(0) NULL COMMENT '最近登录时间',
  8. PRIMARY KEY (`id`)
  9. ) ENGINE = InnoDB AUTO_INCREMENT = 10101000 COMMENT = '用户表';
  10. CREATE TABLE `privatedomain`.`agency_info` (
  11. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  12. `user_id` bigint(20) NULL COMMENT '用户id',
  13. `contacts` varchar(124) NULL COMMENT '联系人名称',
  14. `phone` varchar(124) NULL COMMENT '联系电话',
  15. `wx_num` varchar(64) NULL COMMENT '联系人微信',
  16. `video_account` varchar(255) NULL COMMENT '视频号名称',
  17. `video_account_fans` integer(10) NULL COMMENT '视频号粉丝数',
  18. PRIMARY KEY (`id`)
  19. ) ENGINE = InnoDB AUTO_INCREMENT = 10010121 COMMENT = '代言资质需完善的信息表';
  20. CREATE TABLE `privatedomain`.`orders` (
  21. `order_no` bigint(20) NOT NULL AUTO_INCREMENT,
  22. `busi_order_type` varchar(20) NULL COMMENT '业务订单类型(业务方区分不同订单)',
  23. `busi_order_name` varchar(32) NULL COMMENT '业务名字',
  24. `subjects` varchar(64) NULL COMMENT '订单信息,支付标题',
  25. `total_amount` decimal(11, 0) NULL COMMENT '订单金额',
  26. `order_status` tinyint(4) NULL COMMENT '订单状态,OrderStatusEnum',
  27. `pay_status` tinyint(4) NULL COMMENT '支付状态,PayStatusEnum',
  28. `pay_no` varchar(64) NULL COMMENT '支付号',
  29. `create_time` timestamp(0) NULL COMMENT '创建时间',
  30. `update_time` timestamp(0) NULL COMMENT '更新时间',
  31. `user_id` bigint(20) NULL COMMENT '用户id',
  32. `content_id` bigint(20) NULL COMMENT '支付内容id',
  33. `refund_time` datetime(0) NULL COMMENT '退款时间',
  34. PRIMARY KEY (`order_no`),
  35. UNIQUE INDEX `orderNo`(`order_no`) USING BTREE,
  36. UNIQUE INDEX `payNo`(`pay_no`(32)) USING BTREE
  37. ) ENGINE = InnoDB AUTO_INCREMENT = 10210013 COMMENT = '订单表';
  38. CREATE TABLE `privatedomain`.`pay_content` (
  39. `id` bigint(20) NOT NULL,
  40. `sn` varchar(32) NULL COMMENT '类型',
  41. `parent_id` bigint(20) NULL COMMENT '父类id',
  42. `quantity` int(10) NULL COMMENT '数量',
  43. `unit_price` decimal(10, 2) NULL COMMENT '原来的单价',
  44. `total_amount` decimal(10, 0) NULL COMMENT '总价',
  45. `remarks` varchar(32) NULL COMMENT '备注',
  46. `status` tinyint(4) NULL COMMENT '状态:0正常,1:下架',
  47. PRIMARY KEY (`id`)
  48. ) ENGINE = InnoDB AUTO_INCREMENT = 11110111 COMMENT = '系统配置的可以消费的数据表';
  49. CREATE TABLE `privatedomain`.`invite_relationship` (
  50. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  51. `user_id` bigint(20) NULL COMMENT '被邀请人id',
  52. `inviter_id` bigint(20) NULL COMMENT '邀请人id',
  53. PRIMARY KEY (`id`)
  54. ) ENGINE = InnoDB AUTO_INCREMENT = 10704000 COMMENT = '邀请关系表';
  55. CREATE TABLE `privatedomain`.`private_domain` (
  56. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  57. `user_id` bigint(20) NOT NULL,
  58. `type` tinyint(2) NULL COMMENT '类型:0会员,1额外购买',
  59. `background_id` bigint(20) NULL COMMENT '背景id',
  60. `qr_code_id` bigint(20) NULL COMMENT '二维码图片id',
  61. `content` varchar(255) NULL COMMENT '文案',
  62. `wechat_num` varchar(255) NULL COMMENT '微信号',
  63. `auto_change_qr` tinyint(2) NULL COMMENT '自动更换二维码开关',
  64. `create_time` timestamp(0) NULL COMMENT '创建时间',
  65. `update_time` timestamp(0) NULL COMMENT '更新时间',
  66. PRIMARY KEY (`id`)
  67. ) ENGINE = InnoDB AUTO_INCREMENT = 34002100 COMMENT = '用户私域站';
  68. CREATE TABLE `privatedomain`.`background_image` (
  69. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  70. `user_id` bigint(20) NULL COMMENT '用户id',
  71. `img_src` varchar(255) NULL COMMENT '图片地址',
  72. `status` varchar(255) NULL COMMENT '状态',
  73. `create_time` timestamp(0) NULL COMMENT '创建时间',
  74. `update_time` timestamp(0) NULL COMMENT '更新时间',
  75. PRIMARY KEY (`id`)
  76. ) ENGINE = InnoDB AUTO_INCREMENT = 23001200 COMMENT = '背景图片';
  77. CREATE TABLE `privatedomain`.`user_qr_code` (
  78. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  79. `user_id` bigint(20) NULL COMMENT '用户id',
  80. `qr_code_src` varchar(255) NULL COMMENT '二维码图片地址',
  81. `auto_change` tinyint(2) NULL COMMENT '自动更换',
  82. PRIMARY KEY (`id`)
  83. ) ENGINE = InnoDB AUTO_INCREMENT = 18300000 COMMENT = '用户微信二维码';
  84. CREATE TABLE `system_config` (
  85. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  86. `name` varchar(32) DEFAULT NULL COMMENT '名称',
  87. `value` varchar(256) DEFAULT NULL COMMENT '值',
  88. `des` varchar(128) DEFAULT NULL COMMENT '文字描述',
  89. `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  90. `update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  91. `sn` varchar(20) DEFAULT NULL COMMENT '编码',
  92. PRIMARY KEY (`id`)
  93. ) ENGINE=InnoDB AUTO_INCREMENT=10001037 DEFAULT CHARSET=utf8mb4 COMMENT='系统初始化配置参数';
  94. CREATE TABLE `trade_process_error` (
  95. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  96. `order_no` varchar(20) DEFAULT NULL COMMENT '订单号',
  97. `create_time` timestamp NULL DEFAULT NULL COMMENT '异常发生时间',
  98. `error_message` varchar(2500) DEFAULT NULL COMMENT '错误信息',
  99. `status` tinyint(4) DEFAULT NULL COMMENT '处理状态',
  100. PRIMARY KEY (`id`)
  101. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  102. CREATE TABLE `privatedomain`.`user_account` (
  103. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  104. `user_id` bigint(20) NULL COMMENT '用户id',
  105. `balance` double(10, 0) NULL COMMENT '余额',
  106. `withdrawal_amount` varchar(255) NULL COMMENT '总提现金额',
  107. PRIMARY KEY (`id`)
  108. ) ENGINE = InnoDB AUTO_INCREMENT = 11230000 COMMENT = '用户钱包';
  109. CREATE TABLE `privatedomain`.`user_account_detail` (
  110. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  111. `user_id` bigint(20) NULL COMMENT '用户id',
  112. `type` tinyint(2) NULL COMMENT '类型:0代言收益,1徒弟收益,2:提现',
  113. `before_balance` double(10, 0) NULL COMMENT '交易钱余额',
  114. `trade_balance` double(10, 0) NULL COMMENT '交易金额',
  115. `after_balance` double(10, 0) NULL COMMENT '交易后金额',
  116. `order_no` bigint(20) NULL COMMENT '订单号',
  117. `disciple_id` bigint(20) NULL COMMENT '徒弟的id',
  118. `create_time` timestamp(0) NULL COMMENT '创建时间',
  119. PRIMARY KEY (`id`)
  120. ) ENGINE = InnoDB AUTO_INCREMENT = 12243400 COMMENT = '用户钱包明细';
  121. CREATE TABLE `admin_permission` (
  122. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  123. `user_id` int(10) unsigned NOT NULL COMMENT '用户ID',
  124. `role_id` int(10) unsigned NOT NULL COMMENT '角色ID',
  125. `create_uid` int(10) unsigned NOT NULL COMMENT '生成此权限的用户ID',
  126. `module_name` varchar(32) DEFAULT '' COMMENT '模块名称PModule.pname',
  127. `privilege` varchar(64) DEFAULT '' COMMENT '权限信息',
  128. `plateform` varchar(16) NOT NULL DEFAULT '' COMMENT '子系统标识',
  129. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  130. PRIMARY KEY (`id`),
  131. KEY `apermission_userid_idx` (`user_id`) USING BTREE
  132. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户权限明细';
  133. CREATE TABLE `admin_role` (
  134. `role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  135. `role_name` varchar(32) NOT NULL COMMENT '角色名称',
  136. `role_desc` varchar(255) NOT NULL COMMENT '角色描述',
  137. `create_uid` int(10) unsigned NOT NULL COMMENT '创建用户的id',
  138. `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否可用',
  139. `plateform` varchar(8) NOT NULL DEFAULT '' COMMENT '子系统标识',
  140. `create_time` datetime DEFAULT NULL,
  141. PRIMARY KEY (`role_id`)
  142. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  143. CREATE TABLE `admin_user` (
  144. `id` int(20) unsigned NOT NULL AUTO_INCREMENT,
  145. `account` varchar(32) NOT NULL DEFAULT '' COMMENT '帐号',
  146. `password` varchar(64) NOT NULL DEFAULT '',
  147. `nameCn` varchar(16) NOT NULL DEFAULT '' COMMENT '中文名',
  148. `nameEn` varchar(16) NOT NULL DEFAULT '' COMMENT '英文名',
  149. `lockFlag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '锁定标识',
  150. `delFlag` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标识',
  151. `genUid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建人',
  152. `createTime` datetime DEFAULT NULL COMMENT '创建时间',
  153. PRIMARY KEY (`id`),
  154. UNIQUE KEY `admin_user_acc_idx` (`account`)
  155. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运营后台用户表';
  156. CREATE TABLE `statistical` (
  157. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  158. `yesterday_register_num` int(10) DEFAULT '0' COMMENT '昨日注册人数',
  159. `yesterday_vip_num` int(10) DEFAULT '0' COMMENT '昨日会员人数',
  160. `yesterday_agency_num` int(10) DEFAULT '0' NULL COMMENT '昨日代言人数',
  161. PRIMARY KEY (`id`)
  162. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  163. CREATE TABLE `privatedomain`.`video_tutorial` (
  164. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  165. `des` varchar(255) NULL COMMENT '描述',
  166. `video_bg_pic_src` varchar(255) NULL COMMENT '视频封面图片',
  167. `video_src` varchar(255) NULL COMMENT '视频地址',
  168. `official_assistant_id` bigint(20) NULL COMMENT '官方小助手id',
  169. `create_time` timestamp(0) NULL COMMENT '创建时间',
  170. `release_time` timestamp(0) NULL COMMENT '发布时间',
  171. PRIMARY KEY (`id`)
  172. ) ENGINE = InnoDB AUTO_INCREMENT = 34006300 COMMENT = '视频教程表';
  173. CREATE TABLE `privatedomain`.`official_assistant` (
  174. `id` bigint(0) NOT NULL AUTO_INCREMENT,
  175. `nick_name` varchar(255) NULL COMMENT '昵称',
  176. `head_img` varchar(255) NULL COMMENT '头像',
  177. PRIMARY KEY (`id`)
  178. ) ENGINE = InnoDB AUTO_INCREMENT = 21001100 COMMENT = '官方小助手';
  179. CREATE TABLE `user_account_with_draw_detail` (
  180. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  181. `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  182. `partner_trade_no` varchar(32) DEFAULT NULL COMMENT '微信商户订单号',
  183. `payment_no` varchar(64) DEFAULT NULL COMMENT '微信付款单号',
  184. `pay_fund_order_id` varchar(64) DEFAULT NULL COMMENT '支付资金流水号',
  185. `with_draw_amount` double(20,2) DEFAULT NULL COMMENT '提现金额',
  186. `create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  187. `status` tinyint(2) DEFAULT NULL COMMENT '状态',
  188. `verify_user_id` bigint(20) DEFAULT NULL COMMENT '审核人id',
  189. `verify_date` timestamp NULL DEFAULT NULL COMMENT '审核时间',
  190. `remark` varchar(256) DEFAULT NULL COMMENT '备注信息',
  191. `transfer_shortcut_url` varchar(300) DEFAULT NULL COMMENT '转账图片',
  192. PRIMARY KEY (`id`)
  193. ) ENGINE=InnoDB AUTO_INCREMENT=10085299 DEFAULT CHARSET=utf8mb4 COMMENT='用户账户提现详情表\n';
  194. CREATE TABLE `with_draw_verify_log` (
  195. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  196. `order_id` bigint(20) DEFAULT NULL COMMENT '订单id',
  197. `operating_time` timestamp NULL DEFAULT NULL COMMENT '操作时间',
  198. `des` varchar(120) DEFAULT NULL COMMENT '状态说明',
  199. PRIMARY KEY (`id`)
  200. ) ENGINE=InnoDB AUTO_INCREMENT=11201400 DEFAULT CHARSET=utf8mb4 COMMENT='提现审核日志';