SQL01-数据表结构.sql 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  2. /*!40101 SET NAMES utf8 */;
  3. /*!50503 SET NAMES utf8mb4 */;
  4. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  5. /*!40103 SET TIME_ZONE='+00:00' */;
  6. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  7. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  8. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  9. DROP TABLE IF EXISTS `base_postage_company`;
  10. CREATE TABLE IF NOT EXISTS `base_postage_company` (
  11. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  12. `name` varchar(50) DEFAULT '' COMMENT '快递公司名称',
  13. `code_1` varchar(50) DEFAULT '' COMMENT '快递公司代码',
  14. `code_2` varchar(50) DEFAULT '' COMMENT '百度快递100代码',
  15. `code_3` varchar(50) DEFAULT '' COMMENT '官方快递100代码',
  16. `remark` varchar(512) DEFAULT '' COMMENT '快递公司描述',
  17. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  18. `status` tinyint(1) DEFAULT '1' COMMENT '状态(0.无效,1.有效)',
  19. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(1已删除,0未删除)',
  20. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  21. PRIMARY KEY (`id`) USING BTREE,
  22. KEY `idx_base_postage_company_code1` (`code_1`) USING BTREE,
  23. KEY `idx_base_postage_company_code2` (`code_2`) USING BTREE,
  24. KEY `idx_base_postage_company_code3` (`code_3`) USING BTREE,
  25. KEY `idx_base_postage_company_status` (`status`) USING BTREE,
  26. KEY `idx_base_postage_company_deleted` (`deleted`) USING BTREE
  27. ) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-快递-公司';
  28. DROP TABLE IF EXISTS `base_postage_region`;
  29. CREATE TABLE IF NOT EXISTS `base_postage_region` (
  30. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  31. `pid` int(11) DEFAULT '0' COMMENT '上级PID',
  32. `first` varchar(50) DEFAULT '' COMMENT '首字母',
  33. `short` varchar(100) DEFAULT '' COMMENT '区域简称',
  34. `name` varchar(100) DEFAULT '' COMMENT '区域名称',
  35. `level` tinyint(4) DEFAULT '0' COMMENT '区域层级',
  36. `pinyin` varchar(100) DEFAULT '' COMMENT '区域拼音',
  37. `code` varchar(100) DEFAULT '' COMMENT '区域邮编',
  38. `status` tinyint(1) DEFAULT '1' COMMENT '使用状态',
  39. `lng` varchar(100) DEFAULT '' COMMENT '所在经度',
  40. `lat` varchar(100) DEFAULT '' COMMENT '所在纬度',
  41. PRIMARY KEY (`id`) USING BTREE,
  42. KEY `idx_base_postage_region_pid` (`pid`) USING BTREE,
  43. KEY `idx_base_postage_region_name` (`name`) USING BTREE
  44. ) ENGINE=InnoDB AUTO_INCREMENT=4019 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='数据-快递-区域';
  45. DROP TABLE IF EXISTS `base_postage_template`;
  46. CREATE TABLE IF NOT EXISTS `base_postage_template` (
  47. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  48. `code` varchar(20) DEFAULT '' COMMENT '模板编号',
  49. `name` varchar(200) DEFAULT '' COMMENT '模板名称',
  50. `normal` text COMMENT '默认规则',
  51. `content` longtext COMMENT '模板规则',
  52. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  53. `status` tinyint(1) DEFAULT '1' COMMENT '模板状态',
  54. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  55. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  56. PRIMARY KEY (`id`) USING BTREE,
  57. KEY `idx_base_postage_template_code` (`code`) USING BTREE,
  58. KEY `idx_base_postage_template_status` (`status`) USING BTREE,
  59. KEY `idx_base_postage_template_deleted` (`deleted`) USING BTREE
  60. ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-快递-模板';
  61. DROP TABLE IF EXISTS `base_user_discount`;
  62. CREATE TABLE IF NOT EXISTS `base_user_discount` (
  63. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  64. `name` varchar(200) DEFAULT '' COMMENT '方案名称',
  65. `items` longtext COMMENT '方案规则',
  66. `remark` varchar(500) DEFAULT '' COMMENT '方案描述',
  67. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  68. `status` tinyint(1) DEFAULT '1' COMMENT '方案状态(1使用,0禁用)',
  69. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  70. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  71. PRIMARY KEY (`id`) USING BTREE,
  72. KEY `idx_base_user_discount_status` (`status`) USING BTREE,
  73. KEY `idx_base_user_discount_deleted` (`deleted`) USING BTREE
  74. ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-基础-折扣';
  75. DROP TABLE IF EXISTS `base_user_message`;
  76. CREATE TABLE IF NOT EXISTS `base_user_message` (
  77. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  78. `type` varchar(50) DEFAULT '' COMMENT '消息类型',
  79. `name` varchar(100) DEFAULT '' COMMENT '消息名称',
  80. `content` longtext COMMENT '消息内容',
  81. `num_read` bigint(20) DEFAULT '0' COMMENT '阅读次数',
  82. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  83. `status` tinyint(1) DEFAULT '1' COMMENT '消息状态(1使用,0禁用)',
  84. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  85. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  86. PRIMARY KEY (`id`) USING BTREE,
  87. KEY `idx_base_user_message_type` (`type`) USING BTREE,
  88. KEY `idx_base_user_message_status` (`status`) USING BTREE,
  89. KEY `idx_base_user_message_deleted` (`deleted`) USING BTREE
  90. ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-基础-通知';
  91. DROP TABLE IF EXISTS `base_user_payment`;
  92. CREATE TABLE IF NOT EXISTS `base_user_payment` (
  93. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  94. `type` varchar(50) DEFAULT '' COMMENT '支付类型',
  95. `code` varchar(20) DEFAULT '' COMMENT '通道编号',
  96. `name` varchar(100) DEFAULT '' COMMENT '支付名称',
  97. `cover` varchar(500) DEFAULT '' COMMENT '支付图标',
  98. `content` longtext COMMENT '支付参数',
  99. `remark` varchar(500) DEFAULT '' COMMENT '支付说明',
  100. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  101. `status` tinyint(1) DEFAULT '1' COMMENT '支付状态(1使用,0禁用)',
  102. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  103. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  104. PRIMARY KEY (`id`) USING BTREE,
  105. KEY `idx_base_user_payment_type` (`type`) USING BTREE,
  106. KEY `idx_base_user_payment_code` (`code`) USING BTREE,
  107. KEY `idx_base_user_payment_status` (`status`) USING BTREE,
  108. KEY `idx_base_user_payment_deleted` (`deleted`) USING BTREE
  109. ) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-基础-支付';
  110. DROP TABLE IF EXISTS `base_user_upgrade`;
  111. CREATE TABLE IF NOT EXISTS `base_user_upgrade` (
  112. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  113. `name` varchar(200) DEFAULT '' COMMENT '用户级别名称',
  114. `number` tinyint(2) DEFAULT '0' COMMENT '用户级别序号',
  115. `rebate_rule` varchar(255) DEFAULT '' COMMENT '用户奖利规则',
  116. `upgrade_type` tinyint(1) DEFAULT '0' COMMENT '会员升级规则(0单个,1同时)',
  117. `upgrade_team` tinyint(1) DEFAULT '1' COMMENT '团队人数统计(0不计,1累计)',
  118. `goods_vip_status` tinyint(1) DEFAULT '0' COMMENT '入会礼包状态',
  119. `order_amount_status` tinyint(1) DEFAULT '0' COMMENT '订单金额状态',
  120. `order_amount_number` decimal(20,2) DEFAULT '0.00' COMMENT '订单金额累计',
  121. `teams_users_status` tinyint(1) DEFAULT '0' COMMENT '团队人数状态',
  122. `teams_users_number` bigint(20) DEFAULT '0' COMMENT '团队人数累计',
  123. `teams_direct_status` tinyint(1) DEFAULT '0' COMMENT '直推人数状态',
  124. `teams_direct_number` bigint(20) DEFAULT '0' COMMENT '直推人数累计',
  125. `teams_indirect_status` tinyint(1) DEFAULT '0' COMMENT '间推人数状态',
  126. `teams_indirect_number` bigint(20) DEFAULT '0' COMMENT '间推人数累计',
  127. `remark` varchar(500) DEFAULT '' COMMENT '用户级别描述',
  128. `utime` bigint(20) DEFAULT '0' COMMENT '等级更新时间',
  129. `status` tinyint(1) DEFAULT '1' COMMENT '用户等级状态(1使用,0禁用)',
  130. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '等级创建时间',
  131. PRIMARY KEY (`id`) USING BTREE,
  132. KEY `idx_base_user_upgrade_status` (`status`) USING BTREE,
  133. KEY `idx_base_user_upgrade_number` (`number`) USING BTREE
  134. ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-等级';
  135. DROP TABLE IF EXISTS `data_news_item`;
  136. CREATE TABLE IF NOT EXISTS `data_news_item` (
  137. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  138. `code` varchar(20) DEFAULT '' COMMENT '文章编号',
  139. `name` varchar(100) DEFAULT '' COMMENT '文章标题',
  140. `mark` varchar(200) DEFAULT '' COMMENT '文章标签',
  141. `cover` varchar(500) DEFAULT '' COMMENT '文章封面',
  142. `remark` varchar(500) DEFAULT '' COMMENT '备注说明',
  143. `content` longtext COMMENT '文章内容',
  144. `num_like` bigint(20) DEFAULT '0' COMMENT '文章点赞数',
  145. `num_read` bigint(20) DEFAULT '0' COMMENT '文章阅读数',
  146. `num_collect` bigint(20) DEFAULT '0' COMMENT '文章收藏数',
  147. `num_comment` bigint(20) DEFAULT '0' COMMENT '文章评论数',
  148. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  149. `status` tinyint(1) DEFAULT '1' COMMENT '文章状态(1使用,0禁用)',
  150. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0未删,1已删)',
  151. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  152. PRIMARY KEY (`id`) USING BTREE,
  153. KEY `idx_data_news_item_code` (`code`) USING BTREE,
  154. KEY `idx_data_news_item_status` (`status`) USING BTREE,
  155. KEY `idx_data_news_item_deleted` (`deleted`) USING BTREE
  156. ) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-文章-内容';
  157. DROP TABLE IF EXISTS `data_news_mark`;
  158. CREATE TABLE IF NOT EXISTS `data_news_mark` (
  159. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  160. `name` varchar(100) DEFAULT '' COMMENT '标签名称',
  161. `remark` varchar(500) DEFAULT '' COMMENT '标签说明',
  162. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  163. `status` tinyint(1) DEFAULT '1' COMMENT '标签状态(1使用,0禁用)',
  164. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  165. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  166. PRIMARY KEY (`id`) USING BTREE,
  167. KEY `idx_data_news_mark_status` (`status`) USING BTREE,
  168. KEY `idx_data_news_mark_deleted` (`deleted`) USING BTREE
  169. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-文章-标签';
  170. DROP TABLE IF EXISTS `data_news_x_collect`;
  171. CREATE TABLE IF NOT EXISTS `data_news_x_collect` (
  172. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  173. `uuid` bigint(20) DEFAULT '0' COMMENT '用户UID',
  174. `type` tinyint(1) DEFAULT '1' COMMENT '记录类型(1收藏,2点赞,3历史,4评论)',
  175. `code` varchar(20) DEFAULT '' COMMENT '文章编号',
  176. `reply` longtext COMMENT '评论内容',
  177. `status` tinyint(1) DEFAULT '1' COMMENT '记录状态(0无效,1待审核,2已审核)',
  178. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  179. PRIMARY KEY (`id`) USING BTREE,
  180. KEY `idx_data_news_x_collect_type` (`type`) USING BTREE,
  181. KEY `idx_data_news_x_collect_code` (`code`) USING BTREE,
  182. KEY `idx_data_news_x_collect_status` (`status`) USING BTREE,
  183. KEY `idx_data_news_x_collect_uuid` (`uuid`) USING BTREE
  184. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-文章-标记';
  185. DROP TABLE IF EXISTS `data_user`;
  186. CREATE TABLE IF NOT EXISTS `data_user` (
  187. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  188. `pid0` bigint(20) DEFAULT '0' COMMENT '临时推荐人UID',
  189. `pid1` bigint(20) DEFAULT '0' COMMENT '推荐人一级UID',
  190. `pid2` bigint(20) DEFAULT '0' COMMENT '推荐人二级UID',
  191. `pids` tinyint(1) DEFAULT '0' COMMENT '推荐人绑定状态',
  192. `path` varchar(999) DEFAULT '-' COMMENT '推荐关系路径',
  193. `layer` bigint(20) DEFAULT '1' COMMENT '推荐关系层级',
  194. `openid1` varchar(50) DEFAULT '' COMMENT '小程序OPENID',
  195. `openid2` varchar(50) DEFAULT '' COMMENT '服务号OPENID',
  196. `unionid` varchar(50) DEFAULT '' COMMENT '公众号UnionID',
  197. `phone` varchar(20) DEFAULT '' COMMENT '用户手机',
  198. `headimg` varchar(500) DEFAULT '' COMMENT '用户头像',
  199. `username` varchar(50) DEFAULT '' COMMENT '用户姓名',
  200. `nickname` varchar(99) DEFAULT '' COMMENT '用户昵称',
  201. `password` varchar(32) DEFAULT '' COMMENT '登录密码',
  202. `region_province` varchar(30) DEFAULT '' COMMENT '所在省份',
  203. `region_city` varchar(30) DEFAULT '' COMMENT '所在城市',
  204. `region_area` varchar(30) DEFAULT '' COMMENT '所在区域',
  205. `base_age` bigint(20) DEFAULT '0' COMMENT '用户年龄',
  206. `base_sex` varchar(10) DEFAULT '' COMMENT '用户性别',
  207. `base_height` varchar(10) DEFAULT '' COMMENT '用户身高',
  208. `base_weight` varchar(10) DEFAULT '' COMMENT '用户体重',
  209. `base_birthday` varchar(20) DEFAULT '' COMMENT '用户生日',
  210. `vip_code` bigint(20) DEFAULT '0' COMMENT 'VIP等级编号',
  211. `vip_name` varchar(30) DEFAULT '普通用户' COMMENT 'VIP等级名称',
  212. `vip_order` varchar(20) DEFAULT '' COMMENT 'VIP升级订单',
  213. `vip_datetime` varchar(20) DEFAULT '' COMMENT 'VIP等级时间',
  214. `buy_vip_entry` tinyint(1) DEFAULT '0' COMMENT '是否入会礼包',
  215. `buy_last_date` varchar(20) DEFAULT '' COMMENT '最后支付时间',
  216. `rebate_total` decimal(20,2) DEFAULT '0.00' COMMENT '返利金额统计',
  217. `rebate_used` decimal(20,2) DEFAULT '0.00' COMMENT '返利提现统计',
  218. `rebate_lock` decimal(20,2) DEFAULT '0.00' COMMENT '返利锁定统计',
  219. `balance_total` decimal(20,2) DEFAULT '0.00' COMMENT '累计充值统计',
  220. `balance_used` decimal(20,2) DEFAULT '0.00' COMMENT '已经使用统计',
  221. `teams_users_total` bigint(20) DEFAULT '0' COMMENT '团队人数统计',
  222. `teams_users_direct` bigint(20) DEFAULT '0' COMMENT '直属人数团队',
  223. `teams_users_indirect` bigint(20) DEFAULT '0' COMMENT '间接人数团队',
  224. `order_amount_total` decimal(20,2) DEFAULT '0.00' COMMENT '订单交易统计',
  225. `teams_amount_total` decimal(20,2) DEFAULT '0.00' COMMENT '二级团队业绩',
  226. `teams_amount_direct` decimal(20,2) DEFAULT '0.00' COMMENT '直属团队业绩',
  227. `teams_amount_indirect` decimal(20,2) DEFAULT '0.00' COMMENT '间接团队业绩',
  228. `remark` varchar(500) DEFAULT '' COMMENT '用户备注描述',
  229. `status` tinyint(1) DEFAULT '1' COMMENT '用户状态(1正常,0已黑)',
  230. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0未删,1已删)',
  231. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间',
  232. PRIMARY KEY (`id`) USING BTREE,
  233. KEY `idx_data_user_status` (`status`) USING BTREE,
  234. KEY `idx_data_user_deleted` (`deleted`) USING BTREE,
  235. KEY `idx_data_user_openid1` (`openid1`) USING BTREE,
  236. KEY `idx_data_user_openid2` (`openid2`) USING BTREE,
  237. KEY `idx_data_user_unionid` (`unionid`) USING BTREE,
  238. KEY `idx_data_user_pid1` (`pid1`) USING BTREE,
  239. KEY `idx_data_user_pid2` (`pid2`) USING BTREE,
  240. KEY `idx_data_user_pid0` (`pid0`) USING BTREE,
  241. KEY `idx_data_user_pids` (`pids`) USING BTREE
  242. ) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-会员';
  243. DROP TABLE IF EXISTS `data_user_address`;
  244. CREATE TABLE IF NOT EXISTS `data_user_address` (
  245. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  246. `uuid` bigint(20) DEFAULT '0' COMMENT '用户UID',
  247. `type` tinyint(1) DEFAULT '0' COMMENT '地址类型(0普通,1默认)',
  248. `code` varchar(20) DEFAULT '' COMMENT '地址编号',
  249. `name` varchar(100) DEFAULT '' COMMENT '收货姓名',
  250. `phone` varchar(20) DEFAULT '' COMMENT '收货手机',
  251. `idcode` varchar(255) DEFAULT '' COMMENT '身体证号',
  252. `idimg1` varchar(500) DEFAULT '' COMMENT '身份证正面',
  253. `idimg2` varchar(500) DEFAULT '' COMMENT '身份证反面',
  254. `province` varchar(100) DEFAULT '' COMMENT '地址-省份',
  255. `city` varchar(100) DEFAULT '' COMMENT '地址-城市',
  256. `area` varchar(100) DEFAULT '' COMMENT '地址-区域',
  257. `address` varchar(255) DEFAULT '' COMMENT '地址-详情',
  258. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  259. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  260. PRIMARY KEY (`id`) USING BTREE,
  261. KEY `idx_data_user_address_type` (`type`) USING BTREE,
  262. KEY `idx_data_user_address_code` (`code`) USING BTREE,
  263. KEY `idx_data_user_address_deleted` (`deleted`) USING BTREE,
  264. KEY `idx_data_user_address_uuid` (`uuid`) USING BTREE
  265. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-地址';
  266. DROP TABLE IF EXISTS `data_user_balance`;
  267. CREATE TABLE IF NOT EXISTS `data_user_balance` (
  268. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  269. `uuid` bigint(20) DEFAULT '0' COMMENT '用户UID',
  270. `code` varchar(20) DEFAULT '' COMMENT '充值编号',
  271. `name` varchar(200) DEFAULT '' COMMENT '充值名称',
  272. `remark` varchar(999) DEFAULT '' COMMENT '充值备注',
  273. `amount` decimal(20,2) DEFAULT '0.00' COMMENT '充值金额',
  274. `upgrade` tinyint(20) DEFAULT '0' COMMENT '强制升级',
  275. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  276. `create_by` bigint(20) DEFAULT '0' COMMENT '系统用户',
  277. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  278. PRIMARY KEY (`id`) USING BTREE,
  279. KEY `idx_data_user_balance_code` (`code`) USING BTREE,
  280. KEY `idx_data_user_balance_deleted` (`deleted`) USING BTREE,
  281. KEY `idx_data_user_balance_uuid` (`uuid`) USING BTREE
  282. ) ENGINE=InnoDB AUTO_INCREMENT=136 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-余额';
  283. DROP TABLE IF EXISTS `data_user_message`;
  284. CREATE TABLE IF NOT EXISTS `data_user_message` (
  285. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  286. `type` tinyint(1) DEFAULT '1' COMMENT '短信类型',
  287. `msgid` varchar(50) DEFAULT '' COMMENT '消息编号',
  288. `phone` varchar(100) DEFAULT '' COMMENT '目标手机',
  289. `region` varchar(100) DEFAULT '' COMMENT '国家编号',
  290. `result` varchar(100) DEFAULT '' COMMENT '返回结果',
  291. `content` varchar(512) DEFAULT '' COMMENT '短信内容',
  292. `status` tinyint(1) DEFAULT '0' COMMENT '短信状态(0失败,1成功)',
  293. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  294. PRIMARY KEY (`id`) USING BTREE,
  295. KEY `idx_data_user_message_type` (`type`) USING BTREE,
  296. KEY `idx_data_user_message_status` (`status`) USING BTREE,
  297. KEY `idx_data_user_message_phone` (`phone`) USING BTREE,
  298. KEY `idx_data_user_message_msgid` (`msgid`) USING BTREE
  299. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-短信';
  300. DROP TABLE IF EXISTS `data_user_payment`;
  301. CREATE TABLE IF NOT EXISTS `data_user_payment` (
  302. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  303. `order_no` varchar(20) DEFAULT '' COMMENT '订单单号',
  304. `order_name` varchar(255) DEFAULT '' COMMENT '订单描述',
  305. `order_amount` decimal(20,2) DEFAULT '0.00' COMMENT '订单金额',
  306. `payment_code` varchar(20) DEFAULT '' COMMENT '支付编号',
  307. `payment_type` varchar(50) DEFAULT '' COMMENT '支付通道',
  308. `payment_trade` varchar(100) DEFAULT '' COMMENT '支付单号',
  309. `payment_status` tinyint(1) DEFAULT '0' COMMENT '支付状态',
  310. `payment_amount` decimal(20,2) DEFAULT '0.00' COMMENT '支付金额',
  311. `payment_datatime` varchar(20) DEFAULT '' COMMENT '支付时间',
  312. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  313. PRIMARY KEY (`id`) USING BTREE,
  314. KEY `idx_data_user_payment_order_no` (`order_no`) USING BTREE,
  315. KEY `idx_data_user_payment_payment_code` (`payment_code`) USING BTREE,
  316. KEY `idx_data_user_payment_payment_type` (`payment_type`) USING BTREE,
  317. KEY `idx_data_user_payment_payment_trade` (`payment_trade`) USING BTREE,
  318. KEY `idx_data_user_payment_payment_status` (`payment_status`) USING BTREE
  319. ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-支付';
  320. DROP TABLE IF EXISTS `data_user_rebate`;
  321. CREATE TABLE IF NOT EXISTS `data_user_rebate` (
  322. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  323. `uuid` bigint(20) DEFAULT '0' COMMENT '用户UID',
  324. `date` varchar(20) DEFAULT '' COMMENT '奖励日期',
  325. `code` varchar(20) DEFAULT '' COMMENT '奖励编号',
  326. `type` varchar(20) DEFAULT '' COMMENT '奖励类型',
  327. `name` varchar(100) DEFAULT '' COMMENT '奖励名称',
  328. `amount` decimal(20,2) DEFAULT '0.00' COMMENT '奖励数量',
  329. `order_no` varchar(20) DEFAULT '' COMMENT '订单单号',
  330. `order_uuid` bigint(20) DEFAULT '0' COMMENT '订单用户',
  331. `order_amount` decimal(20,2) DEFAULT '0.00' COMMENT '订单金额',
  332. `status` tinyint(1) DEFAULT '1' COMMENT '生效状态(0未生效,1已生效)',
  333. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0未删除,1已删除)',
  334. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  335. PRIMARY KEY (`id`) USING BTREE,
  336. KEY `idx_data_user_rebate_type` (`type`) USING BTREE,
  337. KEY `idx_data_user_rebate_date` (`date`) USING BTREE,
  338. KEY `idx_data_user_rebate_code` (`code`) USING BTREE,
  339. KEY `idx_data_user_rebate_name` (`name`) USING BTREE,
  340. KEY `idx_data_user_rebate_status` (`status`) USING BTREE,
  341. KEY `idx_data_user_rebate_uuid` (`uuid`) USING BTREE
  342. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-返利';
  343. DROP TABLE IF EXISTS `data_user_token`;
  344. CREATE TABLE IF NOT EXISTS `data_user_token` (
  345. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  346. `uuid` bigint(20) DEFAULT '0' COMMENT '用户UID',
  347. `type` varchar(20) DEFAULT '' COMMENT '授权类型',
  348. `time` bigint(20) DEFAULT '0' COMMENT '有效时间',
  349. `token` varchar(32) DEFAULT '' COMMENT '授权令牌',
  350. `tokenv` varchar(32) DEFAULT '' COMMENT '授权验证',
  351. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  352. PRIMARY KEY (`id`) USING BTREE,
  353. KEY `idx_data_user_token_uuid` (`uuid`),
  354. KEY `idx_data_user_token_type` (`type`) USING BTREE,
  355. KEY `idx_data_user_token_time` (`time`) USING BTREE,
  356. KEY `idx_data_user_token_token` (`token`) USING BTREE
  357. ) ENGINE=InnoDB AUTO_INCREMENT=155 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-认证';
  358. DROP TABLE IF EXISTS `data_user_transfer`;
  359. CREATE TABLE IF NOT EXISTS `data_user_transfer` (
  360. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  361. `uuid` bigint(20) DEFAULT '0' COMMENT '用户UID',
  362. `type` varchar(30) DEFAULT '' COMMENT '提现方式',
  363. `date` varchar(20) DEFAULT '' COMMENT '提现日期',
  364. `code` varchar(100) DEFAULT '' COMMENT '提现单号',
  365. `appid` varchar(100) DEFAULT '' COMMENT '公众号APPID',
  366. `openid` varchar(100) DEFAULT '' COMMENT '公众号OPENID',
  367. `charge_rate` decimal(20,4) DEFAULT '0.0000' COMMENT '提现手续费比例',
  368. `charge_amount` decimal(20,2) DEFAULT '0.00' COMMENT '提现手续费金额',
  369. `amount` decimal(20,2) DEFAULT '0.00' COMMENT '提现转账金额',
  370. `qrcode` varchar(999) DEFAULT '' COMMENT '收款码图片地址',
  371. `bank_wseq` varchar(20) DEFAULT '' COMMENT '微信银行编号',
  372. `bank_name` varchar(100) DEFAULT '' COMMENT '开户银行名称',
  373. `bank_bran` varchar(100) DEFAULT '' COMMENT '开户分行名称',
  374. `bank_user` varchar(100) DEFAULT '' COMMENT '开户账号姓名',
  375. `bank_code` varchar(100) DEFAULT '' COMMENT '开户银行卡号',
  376. `alipay_user` varchar(100) DEFAULT '' COMMENT '支付宝姓名',
  377. `alipay_code` varchar(100) DEFAULT '' COMMENT '支付宝账号',
  378. `remark` varchar(200) DEFAULT '' COMMENT '提现描述',
  379. `trade_no` varchar(100) DEFAULT '' COMMENT '交易单号',
  380. `trade_time` varchar(20) DEFAULT '' COMMENT '打款时间',
  381. `change_time` varchar(20) DEFAULT '' COMMENT '处理时间',
  382. `change_desc` varchar(500) DEFAULT '' COMMENT '处理描述',
  383. `audit_status` tinyint(1) DEFAULT '0' COMMENT '审核状态',
  384. `audit_remark` varchar(500) DEFAULT '' COMMENT '审核描述',
  385. `audit_datetime` varchar(20) DEFAULT '' COMMENT '审核时间',
  386. `status` tinyint(1) DEFAULT '1' COMMENT '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)',
  387. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  388. PRIMARY KEY (`id`) USING BTREE,
  389. KEY `idx_data_user_transfer_code` (`code`) USING BTREE,
  390. KEY `idx_data_user_transfer_status` (`status`) USING BTREE,
  391. KEY `idx_data_user_transfer_date` (`date`) USING BTREE,
  392. KEY `idx_data_user_transfer_type` (`type`) USING BTREE,
  393. KEY `idx_data_user_transfer_audit_status` (`audit_status`) USING BTREE,
  394. KEY `idx_data_user_transfer_appid` (`appid`) USING BTREE,
  395. KEY `idx_data_user_transfer_openid` (`openid`) USING BTREE,
  396. KEY `idx_data_user_transfer_uuid` (`uuid`) USING BTREE
  397. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='数据-用户-提现';
  398. DROP TABLE IF EXISTS `shop_goods`;
  399. CREATE TABLE IF NOT EXISTS `shop_goods` (
  400. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  401. `code` varchar(20) DEFAULT '' COMMENT '商品编号',
  402. `name` varchar(500) DEFAULT '' COMMENT '商品名称',
  403. `marks` varchar(999) DEFAULT '' COMMENT '商品标签',
  404. `cateids` varchar(999) DEFAULT '' COMMENT '分类编号',
  405. `cover` varchar(999) DEFAULT '' COMMENT '商品封面',
  406. `slider` longtext COMMENT '轮播图片',
  407. `remark` varchar(999) DEFAULT '' COMMENT '商品描述',
  408. `content` longtext COMMENT '商品详情',
  409. `payment` varchar(999) DEFAULT '' COMMENT '支付方式',
  410. `data_specs` longtext COMMENT '商品规格(JSON)',
  411. `data_items` longtext COMMENT '商品规格(JSON)',
  412. `stock_total` bigint(20) DEFAULT '0' COMMENT '商品库存统计',
  413. `stock_sales` bigint(20) DEFAULT '0' COMMENT '商品销售统计',
  414. `stock_virtual` bigint(20) DEFAULT '0' COMMENT '商品虚拟销量',
  415. `price_selling` decimal(20,2) DEFAULT '0.00' COMMENT '最低销售价格',
  416. `price_market` decimal(20,2) DEFAULT '0.00' COMMENT '最低市场价格',
  417. `discount_id` bigint(20) DEFAULT '0' COMMENT '折扣方案编号',
  418. `truck_code` varchar(20) DEFAULT '' COMMENT '物流运费模板',
  419. `truck_type` tinyint(1) DEFAULT '0' COMMENT '物流配送(0无需配送,1需要配送)',
  420. `rebate_type` tinyint(1) DEFAULT '1' COMMENT '参与返利(0无需返利,1需要返利)',
  421. `vip_entry` tinyint(1) DEFAULT '0' COMMENT '入会礼包(0非入会礼包,1是入会礼包)',
  422. `vip_upgrade` bigint(20) DEFAULT '0' COMMENT '购买升级等级(0不升级,其他升级)',
  423. `limit_low_vip` bigint(20) DEFAULT '0' COMMENT '限制最低等级(0不限制,其他限制)',
  424. `limit_max_num` bigint(20) DEFAULT '0' COMMENT '最大购买数量(0不限制,其他限制)',
  425. `num_read` bigint(20) DEFAULT '0' COMMENT '访问阅读统计',
  426. `state_hot` tinyint(1) DEFAULT '0' COMMENT '设置热度标签',
  427. `state_home` tinyint(1) DEFAULT '0' COMMENT '设置首页推荐',
  428. `sort` bigint(20) DEFAULT '0' COMMENT '列表排序权重',
  429. `status` tinyint(1) DEFAULT '1' COMMENT '商品状态(1使用,0禁用)',
  430. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0未删,1已删)',
  431. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  432. PRIMARY KEY (`id`) USING BTREE,
  433. KEY `idx_shop_goods_code` (`code`) USING BTREE,
  434. KEY `idx_shop_goods_status` (`status`) USING BTREE,
  435. KEY `idx_shop_goods_deleted` (`deleted`) USING BTREE
  436. ) ENGINE=InnoDB AUTO_INCREMENT=123 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-商品-内容';
  437. DROP TABLE IF EXISTS `shop_goods_cate`;
  438. CREATE TABLE IF NOT EXISTS `shop_goods_cate` (
  439. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  440. `pid` bigint(20) DEFAULT '0' COMMENT '上级分类',
  441. `name` varchar(255) DEFAULT '' COMMENT '分类名称',
  442. `cover` varchar(500) DEFAULT '' COMMENT '分类图标',
  443. `remark` varchar(999) DEFAULT '' COMMENT '分类描述',
  444. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  445. `status` tinyint(1) DEFAULT '1' COMMENT '使用状态',
  446. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态',
  447. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  448. PRIMARY KEY (`id`) USING BTREE,
  449. KEY `idx_shop_goods_cate_sort` (`sort`) USING BTREE,
  450. KEY `idx_shop_goods_cate_status` (`status`) USING BTREE,
  451. KEY `idx_shop_goods_cate_deleted` (`deleted`) USING BTREE
  452. ) ENGINE=InnoDB AUTO_INCREMENT=1023 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-商品-分类';
  453. DROP TABLE IF EXISTS `shop_goods_item`;
  454. CREATE TABLE IF NOT EXISTS `shop_goods_item` (
  455. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  456. `goods_sku` varchar(20) DEFAULT '' COMMENT '商品SKU',
  457. `goods_code` varchar(20) DEFAULT '' COMMENT '商品编号',
  458. `goods_spec` varchar(100) DEFAULT '' COMMENT '商品规格',
  459. `stock_sales` bigint(20) DEFAULT '0' COMMENT '销售数量',
  460. `stock_total` bigint(20) DEFAULT '0' COMMENT '商品库存',
  461. `price_selling` decimal(20,2) DEFAULT '0.00' COMMENT '销售价格',
  462. `price_market` decimal(20,2) DEFAULT '0.00' COMMENT '市场价格',
  463. `number_virtual` bigint(20) DEFAULT '0' COMMENT '虚拟销量',
  464. `number_express` bigint(20) DEFAULT '1' COMMENT '配送计件',
  465. `reward_balance` decimal(20,2) DEFAULT '0.00' COMMENT '奖励余额',
  466. `reward_integral` decimal(20,2) DEFAULT '0.00' COMMENT '奖励积分',
  467. `status` tinyint(1) DEFAULT '1' COMMENT '商品状态',
  468. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  469. PRIMARY KEY (`id`) USING BTREE,
  470. KEY `idx_shop_goods_item_code` (`goods_code`) USING BTREE,
  471. KEY `idx_shop_goods_item_spec` (`goods_spec`) USING BTREE,
  472. KEY `idx_shop_goods_item_status` (`status`) USING BTREE
  473. ) ENGINE=InnoDB AUTO_INCREMENT=736 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-商品-规格';
  474. DROP TABLE IF EXISTS `shop_goods_mark`;
  475. CREATE TABLE IF NOT EXISTS `shop_goods_mark` (
  476. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  477. `name` varchar(100) DEFAULT '' COMMENT '标签名称',
  478. `remark` varchar(200) DEFAULT '' COMMENT '标签描述',
  479. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  480. `status` tinyint(1) DEFAULT '1' COMMENT '标签状态(1使用,0禁用)',
  481. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  482. PRIMARY KEY (`id`) USING BTREE,
  483. KEY `idx_shop_goods_mark_sort` (`sort`) USING BTREE,
  484. KEY `idx_shop_goods_mark_status` (`status`) USING BTREE
  485. ) ENGINE=InnoDB AUTO_INCREMENT=94 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-商品-标签';
  486. DROP TABLE IF EXISTS `shop_goods_stock`;
  487. CREATE TABLE IF NOT EXISTS `shop_goods_stock` (
  488. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  489. `batch_no` varchar(20) DEFAULT '' COMMENT '操作批量',
  490. `goods_code` varchar(20) DEFAULT '' COMMENT '商品编号',
  491. `goods_spec` varchar(100) DEFAULT '' COMMENT '商品规格',
  492. `goods_stock` bigint(20) DEFAULT '0' COMMENT '入库数量',
  493. `status` tinyint(1) DEFAULT '1' COMMENT '数据状态(1使用,0禁用)',
  494. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0未删,1已删)',
  495. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  496. PRIMARY KEY (`id`) USING BTREE,
  497. KEY `idx_shop_goods_stock_status` (`status`) USING BTREE,
  498. KEY `idx_shop_goods_stock_deleted` (`deleted`) USING BTREE
  499. ) ENGINE=InnoDB AUTO_INCREMENT=316 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-商品-库存';
  500. DROP TABLE IF EXISTS `shop_order`;
  501. CREATE TABLE IF NOT EXISTS `shop_order` (
  502. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  503. `uuid` bigint(20) DEFAULT '0' COMMENT '下单用户编号',
  504. `puid1` bigint(20) DEFAULT '0' COMMENT '推荐一层用户',
  505. `puid2` bigint(20) DEFAULT '0' COMMENT '推荐二层用户',
  506. `order_no` varchar(20) DEFAULT '' COMMENT '商品订单单号',
  507. `amount_real` decimal(20,2) DEFAULT '0.00' COMMENT '订单实际金额',
  508. `amount_total` decimal(20,2) DEFAULT '0.00' COMMENT '订单统计金额',
  509. `amount_goods` decimal(20,2) DEFAULT '0.00' COMMENT '商品统计金额',
  510. `amount_reduct` decimal(20,2) DEFAULT '0.00' COMMENT '随机减免金额',
  511. `amount_express` decimal(20,2) DEFAULT '0.00' COMMENT '快递费用金额',
  512. `amount_discount` decimal(20,2) DEFAULT '0.00' COMMENT '折扣后的金额',
  513. `payment_type` varchar(20) DEFAULT '' COMMENT '实际支付平台',
  514. `payment_code` varchar(20) DEFAULT '' COMMENT '实际通道编号',
  515. `payment_allow` varchar(999) DEFAULT '' COMMENT '允许支付通道',
  516. `payment_trade` varchar(80) DEFAULT '' COMMENT '实际支付单号',
  517. `payment_status` tinyint(1) DEFAULT '0' COMMENT '实际支付状态',
  518. `payment_image` varchar(999) DEFAULT '' COMMENT '支付凭证图片',
  519. `payment_amount` decimal(20,2) DEFAULT '0.00' COMMENT '实际支付金额',
  520. `payment_balance` decimal(20,2) DEFAULT '0.00' COMMENT '余额抵扣金额',
  521. `payment_remark` varchar(500) DEFAULT '' COMMENT '支付结果描述',
  522. `payment_datetime` varchar(20) DEFAULT '' COMMENT '支付到账时间',
  523. `number_goods` bigint(20) DEFAULT '0' COMMENT '订单商品数量',
  524. `number_express` bigint(20) DEFAULT '0' COMMENT '订单快递计数',
  525. `truck_type` tinyint(1) DEFAULT '0' COMMENT '物流配送类型(0无需配送,1需要配送)',
  526. `rebate_amount` decimal(20,2) DEFAULT '0.00' COMMENT '参与返利金额',
  527. `reward_balance` decimal(20,2) DEFAULT '0.00' COMMENT '奖励账户余额',
  528. `order_remark` varchar(999) DEFAULT '' COMMENT '订单用户备注',
  529. `cancel_status` tinyint(1) DEFAULT '0' COMMENT '订单取消状态',
  530. `cancel_remark` varchar(200) DEFAULT '' COMMENT '订单取消描述',
  531. `cancel_datetime` varchar(20) DEFAULT '' COMMENT '订单取消时间',
  532. `deleted_status` tinyint(1) DEFAULT '0' COMMENT '订单删除状态(0未删,1已删)',
  533. `deleted_remark` varchar(255) DEFAULT '' COMMENT '订单删除描述',
  534. `deleted_datetime` varchar(20) DEFAULT '' COMMENT '订单删除时间',
  535. `status` tinyint(1) DEFAULT '1' COMMENT '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)',
  536. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间',
  537. PRIMARY KEY (`id`) USING BTREE,
  538. KEY `idx_shop_order_status` (`status`) USING BTREE,
  539. KEY `idx_shop_order_orderno` (`order_no`) USING BTREE,
  540. KEY `idx_shop_order_cancel_status` (`cancel_status`) USING BTREE,
  541. KEY `idx_shop_order_payment_status` (`payment_status`) USING BTREE,
  542. KEY `idx_shop_order_from` (`puid1`) USING BTREE,
  543. KEY `idx_shop_order_deleted` (`deleted_status`) USING BTREE,
  544. KEY `idx_shop_order_mid` (`uuid`) USING BTREE
  545. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-订单-内容';
  546. DROP TABLE IF EXISTS `shop_order_item`;
  547. CREATE TABLE IF NOT EXISTS `shop_order_item` (
  548. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  549. `uuid` bigint(20) DEFAULT '0' COMMENT '商城用户编号',
  550. `order_no` varchar(20) DEFAULT '' COMMENT '商城订单单号',
  551. `goods_sku` varchar(20) DEFAULT '' COMMENT '商城商品SKU',
  552. `goods_code` varchar(20) DEFAULT '' COMMENT '商城商品编号',
  553. `goods_spec` varchar(100) DEFAULT '' COMMENT '商城商品规格',
  554. `goods_name` varchar(250) DEFAULT '' COMMENT '商城商品名称',
  555. `goods_cover` varchar(500) DEFAULT '' COMMENT '商品封面图片',
  556. `goods_payment` varchar(999) DEFAULT '' COMMENT '指定支付通道',
  557. `price_market` decimal(20,2) DEFAULT '0.00' COMMENT '商品市场单价',
  558. `price_selling` decimal(20,2) DEFAULT '0.00' COMMENT '商品销售单价',
  559. `total_market` decimal(20,2) DEFAULT '0.00' COMMENT '商品市场总价',
  560. `total_selling` decimal(20,2) DEFAULT '0.00' COMMENT '商品销售总价',
  561. `reward_balance` decimal(20,2) DEFAULT '0.00' COMMENT '商品奖励余额',
  562. `reward_integral` decimal(20,2) DEFAULT '0.00' COMMENT '商品奖励积分',
  563. `stock_sales` bigint(20) DEFAULT '1' COMMENT '包含商品数量',
  564. `vip_name` varchar(30) DEFAULT '' COMMENT '用户等级名称',
  565. `vip_code` bigint(20) DEFAULT '0' COMMENT '用户等级序号',
  566. `vip_entry` tinyint(1) DEFAULT '0' COMMENT '是否入会礼包(0非礼包,1是礼包)',
  567. `vip_upgrade` bigint(20) DEFAULT '0' COMMENT '升级用户等级',
  568. `truck_type` tinyint(1) DEFAULT '0' COMMENT '物流配送类型(0虚物,1实物)',
  569. `truck_code` varchar(20) DEFAULT '' COMMENT '快递邮费模板',
  570. `truck_number` bigint(20) DEFAULT '0' COMMENT '快递计费基数',
  571. `rebate_type` tinyint(1) DEFAULT '0' COMMENT '参与返利状态(0不返,1返利)',
  572. `rebate_amount` decimal(20,2) DEFAULT '0.00' COMMENT '参与返利金额',
  573. `discount_id` bigint(20) DEFAULT '0' COMMENT '优惠方案编号',
  574. `discount_rate` decimal(20,6) DEFAULT '100.000000' COMMENT '销售价格折扣',
  575. `discount_amount` decimal(20,2) DEFAULT '0.00' COMMENT '商品优惠金额',
  576. `status` tinyint(1) DEFAULT '1' COMMENT '商品状态(1使用,0禁用)',
  577. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0未删,1已删)',
  578. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '订单创建时间',
  579. PRIMARY KEY (`id`) USING BTREE,
  580. KEY `idx_shop_order_item_status` (`status`) USING BTREE,
  581. KEY `idx_shop_order_item_deleted` (`deleted`) USING BTREE,
  582. KEY `idx_shop_order_item_order_no` (`order_no`) USING BTREE,
  583. KEY `idx_shop_order_item_goods_sku` (`goods_sku`) USING BTREE,
  584. KEY `idx_shop_order_item_goods_code` (`goods_code`) USING BTREE,
  585. KEY `idx_shop_order_item_goods_spec` (`goods_spec`) USING BTREE,
  586. KEY `idx_shop_order_item_rebate_type` (`rebate_type`) USING BTREE
  587. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-订单-商品';
  588. DROP TABLE IF EXISTS `shop_order_send`;
  589. CREATE TABLE IF NOT EXISTS `shop_order_send` (
  590. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  591. `uuid` bigint(20) DEFAULT '0' COMMENT '商城用户编号',
  592. `order_no` varchar(20) DEFAULT '' COMMENT '商城订单单号',
  593. `address_code` varchar(20) DEFAULT '' COMMENT '配送地址编号',
  594. `address_name` varchar(50) DEFAULT '' COMMENT '配送收货人姓名',
  595. `address_phone` varchar(20) DEFAULT '' COMMENT '配送收货人手机',
  596. `address_idcode` varchar(100) DEFAULT '' COMMENT '配送收货人证件号码',
  597. `address_idimg1` varchar(500) DEFAULT '' COMMENT '配送收货人证件正面',
  598. `address_idimg2` varchar(500) DEFAULT '' COMMENT '配送收货人证件反面',
  599. `address_province` varchar(30) DEFAULT '' COMMENT '配送地址的省份',
  600. `address_city` varchar(30) DEFAULT '' COMMENT '配送地址的城市',
  601. `address_area` varchar(30) DEFAULT '' COMMENT '配送地址的区域',
  602. `address_content` varchar(255) DEFAULT '' COMMENT '配送的详细地址',
  603. `address_datetime` varchar(20) DEFAULT '' COMMENT '地址确认时间',
  604. `template_code` varchar(20) DEFAULT '' COMMENT '配送模板编号',
  605. `template_count` bigint(20) DEFAULT '0' COMMENT '快递计费基数',
  606. `template_remark` varchar(255) DEFAULT '' COMMENT '配送计算描述',
  607. `template_amount` decimal(20,2) DEFAULT '0.00' COMMENT '配送计算金额',
  608. `company_code` varchar(20) DEFAULT '' COMMENT '快递公司编码',
  609. `company_name` varchar(100) DEFAULT '' COMMENT '快递公司名称',
  610. `send_number` varchar(100) DEFAULT '' COMMENT '快递运送单号',
  611. `send_remark` varchar(255) DEFAULT '' COMMENT '快递发送备注',
  612. `send_datetime` varchar(20) DEFAULT '' COMMENT '快递发送时间',
  613. `status` tinyint(1) DEFAULT '1' COMMENT '发货商品状态(1使用,0禁用)',
  614. `deleted` tinyint(1) DEFAULT '0' COMMENT '发货删除状态(0未删,1已删)',
  615. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  616. PRIMARY KEY (`id`) USING BTREE,
  617. KEY `idx_shop_order_send_status` (`status`) USING BTREE,
  618. KEY `idx_shop_order_send_deleted` (`deleted`) USING BTREE,
  619. KEY `idx_shop_order_send_order_no` (`order_no`) USING BTREE,
  620. KEY `idx_shop_order_send_mid` (`uuid`) USING BTREE
  621. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商城-订单-配送';
  622. DROP TABLE IF EXISTS `system_auth`;
  623. CREATE TABLE IF NOT EXISTS `system_auth` (
  624. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  625. `title` varchar(100) DEFAULT '' COMMENT '权限名称',
  626. `utype` varchar(50) DEFAULT '' COMMENT '身份权限',
  627. `desc` varchar(500) DEFAULT '' COMMENT '备注说明',
  628. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  629. `status` tinyint(1) DEFAULT '1' COMMENT '权限状态(1使用,0禁用)',
  630. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  631. PRIMARY KEY (`id`) USING BTREE,
  632. KEY `idx_system_auth_status` (`status`) USING BTREE,
  633. KEY `idx_system_auth_title` (`title`) USING BTREE
  634. ) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统-权限';
  635. DROP TABLE IF EXISTS `system_auth_node`;
  636. CREATE TABLE IF NOT EXISTS `system_auth_node` (
  637. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  638. `auth` bigint(20) DEFAULT '0' COMMENT '角色',
  639. `node` varchar(200) DEFAULT '' COMMENT '节点',
  640. PRIMARY KEY (`id`) USING BTREE,
  641. KEY `idx_system_auth_auth` (`auth`) USING BTREE,
  642. KEY `idx_system_auth_node` (`node`(191)) USING BTREE
  643. ) ENGINE=InnoDB AUTO_INCREMENT=17235 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统-授权';
  644. DROP TABLE IF EXISTS `system_base`;
  645. CREATE TABLE IF NOT EXISTS `system_base` (
  646. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  647. `type` varchar(20) DEFAULT '' COMMENT '数据类型',
  648. `code` varchar(50) DEFAULT '' COMMENT '数据代码',
  649. `name` varchar(200) DEFAULT '' COMMENT '数据名称',
  650. `content` text COMMENT '数据内容',
  651. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  652. `status` tinyint(1) DEFAULT '1' COMMENT '数据状态(0禁用,1启动)',
  653. `deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0正常,1已删)',
  654. `deleted_at` varchar(20) DEFAULT '' COMMENT '删除时间',
  655. `deleted_by` bigint(20) DEFAULT '0' COMMENT '删除用户',
  656. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  657. PRIMARY KEY (`id`) USING BTREE,
  658. KEY `idx_system_base_type` (`type`) USING BTREE,
  659. KEY `idx_system_base_code` (`code`) USING BTREE,
  660. KEY `idx_system_base_name` (`name`(191)) USING BTREE
  661. ) ENGINE=InnoDB AUTO_INCREMENT=50 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='系统-字典';
  662. DROP TABLE IF EXISTS `system_config`;
  663. CREATE TABLE IF NOT EXISTS `system_config` (
  664. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  665. `type` varchar(20) DEFAULT '' COMMENT '配置分类',
  666. `name` varchar(100) DEFAULT '' COMMENT '配置名称',
  667. `value` varchar(2048) DEFAULT '' COMMENT '配置内容',
  668. PRIMARY KEY (`id`) USING BTREE,
  669. KEY `idx_system_config_type` (`type`) USING BTREE,
  670. KEY `idx_system_config_name` (`name`) USING BTREE
  671. ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='系统-配置';
  672. DROP TABLE IF EXISTS `system_data`;
  673. CREATE TABLE IF NOT EXISTS `system_data` (
  674. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  675. `name` varchar(100) DEFAULT '' COMMENT '配置名',
  676. `value` longtext COMMENT '配置值',
  677. PRIMARY KEY (`id`) USING BTREE,
  678. KEY `idx_system_data_name` (`name`) USING BTREE
  679. ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统-数据';
  680. DROP TABLE IF EXISTS `system_menu`;
  681. CREATE TABLE IF NOT EXISTS `system_menu` (
  682. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  683. `pid` bigint(20) DEFAULT '0' COMMENT '上级ID',
  684. `title` varchar(100) DEFAULT '' COMMENT '菜单名称',
  685. `icon` varchar(100) DEFAULT '' COMMENT '菜单图标',
  686. `node` varchar(100) DEFAULT '' COMMENT '节点代码',
  687. `url` varchar(400) DEFAULT '' COMMENT '链接节点',
  688. `params` varchar(500) DEFAULT '' COMMENT '链接参数',
  689. `target` varchar(20) DEFAULT '_self' COMMENT '打开方式',
  690. `sort` int(11) DEFAULT '0' COMMENT '排序权重',
  691. `status` tinyint(1) DEFAULT '1' COMMENT '状态(0:禁用,1:启用)',
  692. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  693. PRIMARY KEY (`id`) USING BTREE,
  694. KEY `idx_system_menu_status` (`status`) USING BTREE
  695. ) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='系统-菜单';
  696. DROP TABLE IF EXISTS `system_oplog`;
  697. CREATE TABLE IF NOT EXISTS `system_oplog` (
  698. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  699. `node` varchar(200) NOT NULL DEFAULT '' COMMENT '当前操作节点',
  700. `geoip` varchar(15) NOT NULL DEFAULT '' COMMENT '操作者IP地址',
  701. `action` varchar(200) NOT NULL DEFAULT '' COMMENT '操作行为名称',
  702. `content` varchar(1024) NOT NULL DEFAULT '' COMMENT '操作内容描述',
  703. `username` varchar(50) NOT NULL DEFAULT '' COMMENT '操作人用户名',
  704. `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  705. PRIMARY KEY (`id`) USING BTREE
  706. ) ENGINE=InnoDB AUTO_INCREMENT=258 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统-日志';
  707. DROP TABLE IF EXISTS `system_queue`;
  708. CREATE TABLE IF NOT EXISTS `system_queue` (
  709. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  710. `code` varchar(20) NOT NULL DEFAULT '' COMMENT '任务编号',
  711. `title` varchar(100) NOT NULL DEFAULT '' COMMENT '任务名称',
  712. `command` varchar(500) DEFAULT '' COMMENT '执行指令',
  713. `exec_pid` bigint(20) DEFAULT '0' COMMENT '执行进程',
  714. `exec_data` longtext COMMENT '执行参数',
  715. `exec_time` bigint(20) DEFAULT '0' COMMENT '执行时间',
  716. `exec_desc` varchar(500) DEFAULT '' COMMENT '执行描述',
  717. `enter_time` decimal(20,4) DEFAULT '0.0000' COMMENT '开始时间',
  718. `outer_time` decimal(20,4) DEFAULT '0.0000' COMMENT '结束时间',
  719. `loops_time` bigint(20) DEFAULT '0' COMMENT '循环时间',
  720. `attempts` bigint(20) DEFAULT '0' COMMENT '执行次数',
  721. `rscript` tinyint(1) DEFAULT '1' COMMENT '任务类型(0单例,1多例)',
  722. `status` tinyint(1) DEFAULT '1' COMMENT '任务状态(1新任务,2处理中,3成功,4失败)',
  723. `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  724. PRIMARY KEY (`id`) USING BTREE,
  725. KEY `idx_system_queue_code` (`code`) USING BTREE,
  726. KEY `idx_system_queue_title` (`title`) USING BTREE,
  727. KEY `idx_system_queue_status` (`status`) USING BTREE,
  728. KEY `idx_system_queue_rscript` (`rscript`) USING BTREE,
  729. KEY `idx_system_queue_create_at` (`create_at`) USING BTREE,
  730. KEY `idx_system_queue_exec_time` (`exec_time`) USING BTREE
  731. ) ENGINE=InnoDB AUTO_INCREMENT=3198 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统-任务';
  732. DROP TABLE IF EXISTS `system_user`;
  733. CREATE TABLE IF NOT EXISTS `system_user` (
  734. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  735. `usertype` varchar(20) DEFAULT '' COMMENT '用户类型',
  736. `username` varchar(50) DEFAULT '' COMMENT '用户账号',
  737. `password` varchar(32) DEFAULT '' COMMENT '用户密码',
  738. `nickname` varchar(50) DEFAULT '' COMMENT '用户昵称',
  739. `headimg` varchar(255) DEFAULT '' COMMENT '头像地址',
  740. `authorize` varchar(255) DEFAULT '' COMMENT '权限授权',
  741. `contact_qq` varchar(20) DEFAULT '' COMMENT '联系QQ',
  742. `contact_mail` varchar(20) DEFAULT '' COMMENT '联系邮箱',
  743. `contact_phone` varchar(20) DEFAULT '' COMMENT '联系手机',
  744. `login_ip` varchar(255) DEFAULT '' COMMENT '登录地址',
  745. `login_at` varchar(20) DEFAULT '' COMMENT '登录时间',
  746. `login_num` bigint(20) DEFAULT '0' COMMENT '登录次数',
  747. `describe` varchar(255) DEFAULT '' COMMENT '备注说明',
  748. `status` tinyint(1) DEFAULT '1' COMMENT '状态(0禁用,1启用)',
  749. `sort` bigint(20) DEFAULT '0' COMMENT '排序权重',
  750. `is_deleted` tinyint(1) DEFAULT '0' COMMENT '删除(1删除,0未删)',
  751. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  752. PRIMARY KEY (`id`) USING BTREE,
  753. KEY `idx_system_user_status` (`status`) USING BTREE,
  754. KEY `idx_system_user_username` (`username`) USING BTREE,
  755. KEY `idx_system_user_deleted` (`is_deleted`) USING BTREE
  756. ) ENGINE=InnoDB AUTO_INCREMENT=10045 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='系统-用户';
  757. DROP TABLE IF EXISTS `wechat_auto`;
  758. CREATE TABLE IF NOT EXISTS `wechat_auto` (
  759. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  760. `type` varchar(20) DEFAULT '' COMMENT '类型(text,image,news)',
  761. `time` varchar(100) DEFAULT '' COMMENT '延迟时间',
  762. `code` varchar(20) DEFAULT '' COMMENT '消息编号',
  763. `appid` char(100) DEFAULT '' COMMENT '公众号APPID',
  764. `content` text COMMENT '文本内容',
  765. `image_url` varchar(255) DEFAULT '' COMMENT '图片链接',
  766. `voice_url` varchar(255) DEFAULT '' COMMENT '语音链接',
  767. `music_title` varchar(100) DEFAULT '' COMMENT '音乐标题',
  768. `music_url` varchar(255) DEFAULT '' COMMENT '音乐链接',
  769. `music_image` varchar(255) DEFAULT '' COMMENT '缩略图片',
  770. `music_desc` varchar(255) DEFAULT '' COMMENT '音乐描述',
  771. `video_title` varchar(100) DEFAULT '' COMMENT '视频标题',
  772. `video_url` varchar(255) DEFAULT '' COMMENT '视频URL',
  773. `video_desc` varchar(255) DEFAULT '' COMMENT '视频描述',
  774. `news_id` bigint(20) DEFAULT '0' COMMENT '图文ID',
  775. `status` tinyint(1) DEFAULT '1' COMMENT '状态(0禁用,1启用)',
  776. `create_by` bigint(20) DEFAULT '0' COMMENT '创建人',
  777. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  778. PRIMARY KEY (`id`) USING BTREE,
  779. KEY `idx_wechat_auto_type` (`type`) USING BTREE,
  780. KEY `idx_wechat_auto_keys` (`time`) USING BTREE,
  781. KEY `idx_wechat_auto_code` (`code`) USING BTREE,
  782. KEY `idx_wechat_auto_appid` (`appid`) USING BTREE
  783. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信-回复';
  784. DROP TABLE IF EXISTS `wechat_fans`;
  785. CREATE TABLE IF NOT EXISTS `wechat_fans` (
  786. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  787. `appid` varchar(50) DEFAULT '' COMMENT '公众号APPID',
  788. `unionid` varchar(100) DEFAULT '' COMMENT '粉丝unionid',
  789. `openid` varchar(100) DEFAULT '' COMMENT '粉丝openid',
  790. `tagid_list` varchar(100) DEFAULT '' COMMENT '粉丝标签id',
  791. `is_black` tinyint(1) DEFAULT '0' COMMENT '是否为黑名单状态',
  792. `subscribe` tinyint(1) DEFAULT '0' COMMENT '关注状态(0未关注,1已关注)',
  793. `nickname` varchar(200) DEFAULT '' COMMENT '用户昵称',
  794. `sex` tinyint(1) DEFAULT '0' COMMENT '用户性别(1男性,2女性,0未知)',
  795. `country` varchar(50) DEFAULT '' COMMENT '用户所在国家',
  796. `province` varchar(50) DEFAULT '' COMMENT '用户所在省份',
  797. `city` varchar(50) DEFAULT '' COMMENT '用户所在城市',
  798. `language` varchar(50) DEFAULT '' COMMENT '用户的语言(zh_CN)',
  799. `headimgurl` varchar(500) DEFAULT '' COMMENT '用户头像',
  800. `subscribe_time` bigint(20) DEFAULT '0' COMMENT '关注时间',
  801. `subscribe_at` datetime DEFAULT NULL COMMENT '关注时间',
  802. `remark` varchar(50) DEFAULT '' COMMENT '备注',
  803. `subscribe_scene` varchar(200) DEFAULT '' COMMENT '扫码关注场景',
  804. `qr_scene` varchar(100) DEFAULT '' COMMENT '二维码场景值',
  805. `qr_scene_str` varchar(200) DEFAULT '' COMMENT '二维码场景内容',
  806. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  807. PRIMARY KEY (`id`) USING BTREE,
  808. KEY `idx_wechat_fans_openid` (`openid`) USING BTREE,
  809. KEY `idx_wechat_fans_unionid` (`unionid`) USING BTREE,
  810. KEY `idx_wechat_fans_isblack` (`is_black`) USING BTREE,
  811. KEY `idx_wechat_fans_subscribe` (`subscribe`) USING BTREE
  812. ) ENGINE=InnoDB AUTO_INCREMENT=197 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信-粉丝';
  813. DROP TABLE IF EXISTS `wechat_fans_tags`;
  814. CREATE TABLE IF NOT EXISTS `wechat_fans_tags` (
  815. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '标签ID',
  816. `appid` varchar(50) DEFAULT '' COMMENT '公众号APPID',
  817. `name` varchar(35) DEFAULT '' COMMENT '标签名称',
  818. `count` bigint(20) DEFAULT '0' COMMENT '总数',
  819. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
  820. KEY `idx_wechat_fans_tags_id` (`id`) USING BTREE,
  821. KEY `idx_wechat_fans_tags_appid` (`appid`) USING BTREE
  822. ) ENGINE=InnoDB AUTO_INCREMENT=246 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信-标签';
  823. DROP TABLE IF EXISTS `wechat_keys`;
  824. CREATE TABLE IF NOT EXISTS `wechat_keys` (
  825. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  826. `appid` char(100) DEFAULT '' COMMENT '公众号APPID',
  827. `type` varchar(20) DEFAULT '' COMMENT '类型(text,image,news)',
  828. `keys` varchar(100) DEFAULT '' COMMENT '关键字',
  829. `content` text COMMENT '文本内容',
  830. `image_url` varchar(255) DEFAULT '' COMMENT '图片链接',
  831. `voice_url` varchar(255) DEFAULT '' COMMENT '语音链接',
  832. `music_title` varchar(100) DEFAULT '' COMMENT '音乐标题',
  833. `music_url` varchar(255) DEFAULT '' COMMENT '音乐链接',
  834. `music_image` varchar(255) DEFAULT '' COMMENT '缩略图片',
  835. `music_desc` varchar(255) DEFAULT '' COMMENT '音乐描述',
  836. `video_title` varchar(100) DEFAULT '' COMMENT '视频标题',
  837. `video_url` varchar(255) DEFAULT '' COMMENT '视频URL',
  838. `video_desc` varchar(255) DEFAULT '' COMMENT '视频描述',
  839. `news_id` bigint(20) DEFAULT '0' COMMENT '图文ID',
  840. `sort` bigint(20) DEFAULT '0' COMMENT '排序字段',
  841. `status` tinyint(1) DEFAULT '1' COMMENT '状态(0禁用,1启用)',
  842. `create_by` bigint(20) DEFAULT '0' COMMENT '创建人',
  843. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  844. PRIMARY KEY (`id`) USING BTREE,
  845. KEY `idx_wechat_keys_appid` (`appid`) USING BTREE,
  846. KEY `idx_wechat_keys_type` (`type`) USING BTREE,
  847. KEY `idx_wechat_keys_keys` (`keys`) USING BTREE
  848. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信-规则';
  849. DROP TABLE IF EXISTS `wechat_media`;
  850. CREATE TABLE IF NOT EXISTS `wechat_media` (
  851. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  852. `md5` varchar(32) DEFAULT '' COMMENT '文件md5',
  853. `type` varchar(20) DEFAULT '' COMMENT '媒体类型',
  854. `appid` varchar(100) DEFAULT '' COMMENT '公众号ID',
  855. `media_id` varchar(100) DEFAULT '' COMMENT '永久素材MediaID',
  856. `local_url` varchar(300) DEFAULT '' COMMENT '本地文件链接',
  857. `media_url` varchar(300) DEFAULT '' COMMENT '远程图片链接',
  858. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  859. PRIMARY KEY (`id`) USING BTREE,
  860. KEY `idx_wechat_media_appid` (`appid`) USING BTREE,
  861. KEY `idx_wechat_media_md5` (`md5`) USING BTREE,
  862. KEY `idx_wechat_media_type` (`type`) USING BTREE,
  863. KEY `idx_wechat_media_media_id` (`media_id`) USING BTREE
  864. ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信-素材';
  865. DROP TABLE IF EXISTS `wechat_news`;
  866. CREATE TABLE IF NOT EXISTS `wechat_news` (
  867. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  868. `media_id` varchar(100) DEFAULT '' COMMENT '永久素材MediaID',
  869. `local_url` varchar(300) DEFAULT '' COMMENT '永久素材外网URL',
  870. `article_id` varchar(60) DEFAULT '' COMMENT '关联图文ID(用英文逗号做分割)',
  871. `is_deleted` tinyint(1) DEFAULT '0' COMMENT '删除状态(0未删除,1已删除)',
  872. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  873. `create_by` bigint(20) DEFAULT NULL COMMENT '创建人',
  874. PRIMARY KEY (`id`) USING BTREE,
  875. KEY `idx_wechat_news_artcle_id` (`article_id`) USING BTREE,
  876. KEY `idx_wechat_news_media_id` (`media_id`) USING BTREE
  877. ) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信-图文';
  878. DROP TABLE IF EXISTS `wechat_news_article`;
  879. CREATE TABLE IF NOT EXISTS `wechat_news_article` (
  880. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  881. `title` varchar(50) DEFAULT '' COMMENT '素材标题',
  882. `local_url` varchar(300) DEFAULT '' COMMENT '永久素材显示URL',
  883. `show_cover_pic` tinyint(4) DEFAULT '0' COMMENT '显示封面(0不显示,1显示)',
  884. `author` varchar(20) DEFAULT '' COMMENT '文章作者',
  885. `digest` varchar(300) DEFAULT '' COMMENT '摘要内容',
  886. `content` longtext COMMENT '图文内容',
  887. `content_source_url` varchar(200) DEFAULT '' COMMENT '原文地址',
  888. `read_num` bigint(20) DEFAULT '0' COMMENT '阅读数量',
  889. `create_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  890. PRIMARY KEY (`id`) USING BTREE
  891. ) ENGINE=InnoDB AUTO_INCREMENT=198 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='微信-文章';
  892. /*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
  893. /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
  894. /*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
  895. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  896. /*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;