install.sql 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : 本地开发
  4. Source Server Version : 50731
  5. Source Host : localhost:3306
  6. Source Database : wechat
  7. Target Server Type : MYSQL
  8. Target Server Version : 50731
  9. File Encoding : 65001
  10. Date: 2020-12-18 10:30:14
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for ai_smartbc_adwords
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `ai_smartbc_adwords`;
  17. CREATE TABLE `ai_smartbc_adwords` (
  18. `id` int(11) NOT NULL AUTO_INCREMENT,
  19. `member_miniapp_id` int(11) DEFAULT '0',
  20. `open_type` varchar(50) DEFAULT NULL,
  21. `group` varchar(100) DEFAULT NULL,
  22. `title` varchar(50) DEFAULT NULL,
  23. `link` varchar(200) DEFAULT NULL,
  24. `picture` varchar(255) DEFAULT NULL,
  25. `sort` int(11) DEFAULT '0',
  26. `update_time` int(11) DEFAULT NULL,
  27. `create_time` int(11) DEFAULT NULL,
  28. PRIMARY KEY (`id`)
  29. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  30. -- ----------------------------
  31. -- Table structure for ai_smartbc_bill
  32. -- ----------------------------
  33. DROP TABLE IF EXISTS `ai_smartbc_bill`;
  34. CREATE TABLE `ai_smartbc_bill` (
  35. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  36. `member_miniapp_id` int(11) DEFAULT NULL,
  37. `store_id` int(11) DEFAULT '0',
  38. `uid` bigint(20) DEFAULT '0',
  39. `money` decimal(10,2) DEFAULT '0.00',
  40. `message` tinytext,
  41. `update_time` int(11) DEFAULT NULL,
  42. PRIMARY KEY (`id`),
  43. KEY `id` (`id`) USING BTREE,
  44. KEY `id_2` (`id`) USING BTREE
  45. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='个人财务记录';
  46. -- ----------------------------
  47. -- Table structure for ai_smartbc_config
  48. -- ----------------------------
  49. DROP TABLE IF EXISTS `ai_smartbc_config`;
  50. CREATE TABLE `ai_smartbc_config` (
  51. `member_miniapp_id` int(11) NOT NULL,
  52. `service_telephone` varchar(100) DEFAULT NULL,
  53. `end_time` tinyint(4) DEFAULT '0',
  54. `is_pay_open_coupon` tinyint(2) DEFAULT NULL,
  55. `group_join` int(11) DEFAULT NULL,
  56. `group_member` int(11) DEFAULT NULL,
  57. `profit` decimal(10,0) DEFAULT NULL,
  58. `tplmsg_order` varchar(100) DEFAULT NULL COMMENT '支付成功通知',
  59. `tplmsg_point` varchar(100) DEFAULT NULL COMMENT '积分兑换通知',
  60. `sla` text,
  61. `article` text,
  62. PRIMARY KEY (`member_miniapp_id`),
  63. UNIQUE KEY `APPID` (`member_miniapp_id`) USING BTREE
  64. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  65. -- ----------------------------
  66. -- Table structure for ai_smartbc_coupon
  67. -- ----------------------------
  68. DROP TABLE IF EXISTS `ai_smartbc_coupon`;
  69. CREATE TABLE `ai_smartbc_coupon` (
  70. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  71. `member_miniapp_id` int(11) DEFAULT NULL,
  72. `store_id` int(11) DEFAULT NULL,
  73. `is_top` tinyint(1) DEFAULT NULL,
  74. `is_lock` tinyint(1) DEFAULT '0',
  75. `is_super` tinyint(1) DEFAULT '0',
  76. `is_end` tinyint(1) DEFAULT '0' COMMENT '是否过期失效或删除',
  77. `types` tinyint(1) DEFAULT '0' COMMENT '0满减/抵扣1满折/折扣/2储值券',
  78. `price` int(11) DEFAULT '0' COMMENT '满减代金券',
  79. `discount` float(2,1) DEFAULT '0.0' COMMENT '折扣力度',
  80. `amount` decimal(10,2) DEFAULT NULL,
  81. `howmuch` int(10) DEFAULT '0' COMMENT '满多少用',
  82. `name` varchar(255) DEFAULT NULL,
  83. `tips` varchar(255) DEFAULT NULL,
  84. `sort` int(11) DEFAULT '0',
  85. `update_time` int(11) DEFAULT NULL,
  86. `create_time` int(11) DEFAULT NULL COMMENT '0',
  87. PRIMARY KEY (`id`),
  88. KEY `APPID` (`member_miniapp_id`) USING BTREE,
  89. KEY `STOREID` (`store_id`) USING BTREE
  90. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  91. -- ----------------------------
  92. -- Table structure for ai_smartbc_coupon_user
  93. -- ----------------------------
  94. DROP TABLE IF EXISTS `ai_smartbc_coupon_user`;
  95. CREATE TABLE `ai_smartbc_coupon_user` (
  96. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  97. `member_miniapp_id` int(11) DEFAULT NULL,
  98. `store_id` int(11) DEFAULT NULL,
  99. `coupon_id` int(11) DEFAULT NULL,
  100. `parent_store_id` int(11) DEFAULT '0',
  101. `uid` bigint(20) DEFAULT NULL,
  102. `is_end` tinyint(1) DEFAULT '0',
  103. `types` tinyint(4) DEFAULT '0' COMMENT '0满减1打折卷',
  104. `name` varchar(255) DEFAULT NULL,
  105. `price` int(11) DEFAULT NULL COMMENT '分',
  106. `amount` decimal(10,2) DEFAULT NULL,
  107. `discount` float(2,1) DEFAULT NULL,
  108. `howmuch` int(10) DEFAULT NULL COMMENT '元',
  109. `tips` varchar(255) DEFAULT NULL,
  110. `money` decimal(10,2) DEFAULT '0.00',
  111. `group_ids` varchar(11) DEFAULT '0',
  112. `update_time` int(11) DEFAULT NULL,
  113. `create_time` int(11) DEFAULT NULL,
  114. PRIMARY KEY (`id`),
  115. KEY `APPID` (`member_miniapp_id`) USING BTREE,
  116. KEY `STOREID` (`store_id`) USING BTREE
  117. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户的赠品';
  118. -- ----------------------------
  119. -- Table structure for ai_smartbc_order
  120. -- ----------------------------
  121. DROP TABLE IF EXISTS `ai_smartbc_order`;
  122. CREATE TABLE `ai_smartbc_order` (
  123. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  124. `member_miniapp_id` int(11) DEFAULT NULL,
  125. `store_id` int(11) DEFAULT '0' COMMENT '总店',
  126. `store_chain_id` int(11) DEFAULT '0' COMMENT '分店',
  127. `uid` bigint(20) DEFAULT NULL,
  128. `coupon_user_id` int(11) DEFAULT NULL,
  129. `parent_store_id` int(11) DEFAULT '0',
  130. `parent_store_price` decimal(10,2) DEFAULT '0.00',
  131. `amount` decimal(10,2) DEFAULT NULL COMMENT '应付金额',
  132. `price` decimal(10,2) DEFAULT NULL COMMENT '实付金额',
  133. `state` tinyint(2) DEFAULT '0',
  134. `order_no` varchar(255) DEFAULT NULL,
  135. `paid_time` int(11) DEFAULT NULL,
  136. `paid_no` varchar(255) DEFAULT NULL,
  137. `coupon_cache` text,
  138. `update_time` int(11) DEFAULT NULL,
  139. PRIMARY KEY (`id`)
  140. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  141. -- ----------------------------
  142. -- Table structure for ai_smartbc_queen
  143. -- ----------------------------
  144. DROP TABLE IF EXISTS `ai_smartbc_queen`;
  145. CREATE TABLE `ai_smartbc_queen` (
  146. `id` int(11) NOT NULL AUTO_INCREMENT,
  147. `member_miniapp_id` int(11) DEFAULT NULL,
  148. `types` tinyint(1) DEFAULT '0' COMMENT '0:open|1:mchid',
  149. `store_id` bigint(20) DEFAULT NULL,
  150. `uid` bigint(20) DEFAULT NULL,
  151. `mch_id` bigint(20) DEFAULT NULL,
  152. `amount` int(11) DEFAULT NULL,
  153. `transaction_id` varchar(64) DEFAULT NULL,
  154. `out_order_no` varchar(64) DEFAULT NULL,
  155. `order_id` varchar(64) DEFAULT NULL,
  156. `is_finish` tinyint(1) DEFAULT NULL COMMENT '0排队1失败2成',
  157. `msg` varchar(255) DEFAULT NULL,
  158. `sms` varchar(255) DEFAULT NULL,
  159. `update_time` int(11) DEFAULT NULL,
  160. PRIMARY KEY (`id`)
  161. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='任务队列';
  162. -- ----------------------------
  163. -- Table structure for ai_smartbc_store
  164. -- ----------------------------
  165. DROP TABLE IF EXISTS `ai_smartbc_store`;
  166. CREATE TABLE `ai_smartbc_store` (
  167. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  168. `member_miniapp_id` int(11) DEFAULT NULL,
  169. `manage_uid` int(11) DEFAULT '0',
  170. `mch_id` int(11) DEFAULT NULL,
  171. `cate_id` int(11) DEFAULT NULL,
  172. `cate_sid` int(11) DEFAULT NULL,
  173. `cate_name` varchar(255) DEFAULT NULL,
  174. `name` varchar(255) DEFAULT NULL,
  175. `img` varchar(255) DEFAULT NULL,
  176. `imgs` text,
  177. `address` varchar(255) DEFAULT NULL,
  178. `telphone` varchar(255) DEFAULT NULL,
  179. `longitude` decimal(10,7) DEFAULT NULL COMMENT '地图坐标',
  180. `latitude` decimal(10,7) DEFAULT NULL,
  181. `sort` int(11) DEFAULT '0',
  182. `is_top` tinyint(1) DEFAULT '0',
  183. `is_lock` tinyint(1) DEFAULT '0',
  184. `is_pass` tinyint(1) DEFAULT '0',
  185. `create_time` int(11) DEFAULT NULL,
  186. PRIMARY KEY (`id`),
  187. KEY `APPID` (`member_miniapp_id`) USING BTREE,
  188. KEY `CID` (`cate_id`) USING BTREE
  189. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  190. -- ----------------------------
  191. -- Table structure for ai_smartbc_store_bill
  192. -- ----------------------------
  193. DROP TABLE IF EXISTS `ai_smartbc_store_bill`;
  194. CREATE TABLE `ai_smartbc_store_bill` (
  195. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  196. `member_miniapp_id` int(11) DEFAULT NULL,
  197. `store_id` int(11) DEFAULT '0',
  198. `store_chain_id` int(11) DEFAULT '0',
  199. `pay_uid` bigint(20) DEFAULT '0',
  200. `money` decimal(10,2) DEFAULT '0.00',
  201. `message` tinytext,
  202. `update_time` int(11) DEFAULT NULL,
  203. PRIMARY KEY (`id`),
  204. UNIQUE KEY `ID` (`id`) USING BTREE,
  205. KEY `STORE_ID` (`store_id`) USING BTREE,
  206. KEY `UID` (`pay_uid`) USING BTREE
  207. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='好店账单';
  208. -- ----------------------------
  209. -- Table structure for ai_smartbc_store_cate
  210. -- ----------------------------
  211. DROP TABLE IF EXISTS `ai_smartbc_store_cate`;
  212. CREATE TABLE `ai_smartbc_store_cate` (
  213. `id` int(11) NOT NULL AUTO_INCREMENT,
  214. `member_miniapp_id` int(11) DEFAULT NULL,
  215. `parent_id` int(11) DEFAULT '0',
  216. `root_id` int(11) DEFAULT NULL,
  217. `title` varchar(50) DEFAULT NULL,
  218. `name` varchar(50) DEFAULT NULL,
  219. `picture` varchar(100) DEFAULT NULL,
  220. `sort` int(11) DEFAULT '0',
  221. `update_time` int(11) DEFAULT NULL,
  222. `create_time` int(11) DEFAULT NULL,
  223. PRIMARY KEY (`id`),
  224. UNIQUE KEY `ID` (`id`) USING BTREE,
  225. KEY `PARENT_ID` (`parent_id`,`root_id`) USING BTREE
  226. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类信息栏目';
  227. -- ----------------------------
  228. -- Table structure for ai_smartbc_store_chain
  229. -- ----------------------------
  230. DROP TABLE IF EXISTS `ai_smartbc_store_chain`;
  231. CREATE TABLE `ai_smartbc_store_chain` (
  232. `id` int(11) NOT NULL AUTO_INCREMENT,
  233. `member_miniapp_id` int(11) DEFAULT NULL,
  234. `store_id` int(11) DEFAULT NULL,
  235. `title` varchar(100) DEFAULT NULL,
  236. `address` varchar(255) DEFAULT NULL,
  237. `telphone` varchar(50) DEFAULT NULL,
  238. `longitude` varchar(20) DEFAULT NULL,
  239. `latitude` varchar(20) DEFAULT NULL,
  240. `sort` int(11) DEFAULT '0',
  241. `update_time` int(11) DEFAULT NULL,
  242. PRIMARY KEY (`id`)
  243. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='连锁门店';
  244. -- ----------------------------
  245. -- Table structure for ai_smartbc_store_group
  246. -- ----------------------------
  247. DROP TABLE IF EXISTS `ai_smartbc_store_group`;
  248. CREATE TABLE `ai_smartbc_store_group` (
  249. `id` int(11) NOT NULL AUTO_INCREMENT,
  250. `member_miniapp_id` int(11) DEFAULT NULL,
  251. `title` varchar(50) DEFAULT NULL,
  252. `content` varchar(255) DEFAULT NULL,
  253. `face` varchar(255) DEFAULT NULL,
  254. `uid` int(11) DEFAULT NULL,
  255. `create_time` int(11) DEFAULT NULL,
  256. `update_time` int(11) DEFAULT NULL,
  257. PRIMARY KEY (`id`),
  258. UNIQUE KEY `ID` (`id`) USING BTREE
  259. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商圈';
  260. -- ----------------------------
  261. -- Table structure for ai_smartbc_store_union
  262. -- ----------------------------
  263. DROP TABLE IF EXISTS `ai_smartbc_store_union`;
  264. CREATE TABLE `ai_smartbc_store_union` (
  265. `id` int(11) NOT NULL AUTO_INCREMENT,
  266. `member_miniapp_id` int(11) DEFAULT NULL,
  267. `store_id` int(11) DEFAULT NULL,
  268. `group_id` int(11) DEFAULT NULL,
  269. `type` tinyint(2) DEFAULT NULL COMMENT '0正常 1待审核 2拒绝 3退出 4 踢出',
  270. `create_time` int(11) DEFAULT NULL,
  271. `update_time` int(11) DEFAULT NULL,
  272. PRIMARY KEY (`id`)
  273. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商家和圈关联';
  274. SET FOREIGN_KEY_CHECKS=1;