litemall_table.sql 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
  2. --
  3. -- Host: 127.0.0.1 Database: jz
  4. -- ------------------------------------------------------
  5. -- Server version 5.7.21-log
  6. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  7. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  8. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  9. /*!40101 SET NAMES utf8 */;
  10. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  11. /*!40103 SET TIME_ZONE='+00:00' */;
  12. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  13. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  14. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  15. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  16. --
  17. -- Table structure for table `jz_ad`
  18. --
  19. DROP TABLE IF EXISTS `jz_ad`;
  20. /*!40101 SET @saved_cs_client = @@character_set_client */;
  21. /*!40101 SET character_set_client = utf8 */;
  22. CREATE TABLE `jz_ad` (
  23. `id` int(11) NOT NULL AUTO_INCREMENT,
  24. `name` varchar(63) NOT NULL DEFAULT '' COMMENT '广告标题',
  25. `link` varchar(255) NOT NULL DEFAULT '' COMMENT '所广告的商品页面或者活动页面链接地址',
  26. `url` varchar(255) NOT NULL COMMENT '广告宣传图片',
  27. `position` tinyint(3) DEFAULT '1' COMMENT '广告位置:1则是首页',
  28. `content` varchar(255) DEFAULT '' COMMENT '活动内容',
  29. `start_time` datetime DEFAULT NULL COMMENT '广告开始时间',
  30. `end_time` datetime DEFAULT NULL COMMENT '广告结束时间',
  31. `enabled` tinyint(1) DEFAULT '0' COMMENT '是否启动',
  32. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  33. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  34. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  35. PRIMARY KEY (`id`),
  36. KEY `enabled` (`enabled`)
  37. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='广告表';
  38. /*!40101 SET character_set_client = @saved_cs_client */;
  39. --
  40. -- Table structure for table `jz_address`
  41. --
  42. DROP TABLE IF EXISTS `jz_address`;
  43. /*!40101 SET @saved_cs_client = @@character_set_client */;
  44. /*!40101 SET character_set_client = utf8 */;
  45. CREATE TABLE `jz_address` (
  46. `id` int(11) NOT NULL AUTO_INCREMENT,
  47. `name` varchar(63) NOT NULL DEFAULT '' COMMENT '收货人名称',
  48. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户表的用户ID',
  49. `province` varchar(63) NOT NULL COMMENT '行政区域表的省ID',
  50. `city` varchar(63) NOT NULL COMMENT '行政区域表的市ID',
  51. `county` varchar(63) NOT NULL COMMENT '行政区域表的区县ID',
  52. `address_detail` varchar(127) NOT NULL DEFAULT '' COMMENT '详细收货地址',
  53. `area_code` char(6) DEFAULT NULL COMMENT '地区编码',
  54. `postal_code` char(6) DEFAULT NULL COMMENT '邮政编码',
  55. `tel` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号码',
  56. `is_default` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否默认地址',
  57. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  58. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  59. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  60. PRIMARY KEY (`id`),
  61. KEY `user_id` (`user_id`)
  62. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='收货地址表';
  63. /*!40101 SET character_set_client = @saved_cs_client */;
  64. --
  65. -- Table structure for table `jz_admin`
  66. --
  67. DROP TABLE IF EXISTS `jz_admin`;
  68. /*!40101 SET @saved_cs_client = @@character_set_client */;
  69. /*!40101 SET character_set_client = utf8 */;
  70. CREATE TABLE `jz_admin` (
  71. `id` int(11) NOT NULL AUTO_INCREMENT,
  72. `username` varchar(63) NOT NULL DEFAULT '' COMMENT '管理员名称',
  73. `password` varchar(63) NOT NULL DEFAULT '' COMMENT '管理员密码',
  74. `last_login_ip` varchar(63) DEFAULT '' COMMENT '最近一次登录IP地址',
  75. `last_login_time` datetime DEFAULT NULL COMMENT '最近一次登录时间',
  76. `avatar` varchar(255) DEFAULT '''' COMMENT '头像图片',
  77. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  78. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  79. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  80. `role_ids` varchar(127) DEFAULT '[]' COMMENT '角色列表',
  81. PRIMARY KEY (`id`)
  82. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='管理员表';
  83. /*!40101 SET character_set_client = @saved_cs_client */;
  84. --
  85. -- Table structure for table `jz_aftersale`
  86. --
  87. DROP TABLE IF EXISTS `jz_aftersale`;
  88. /*!40101 SET @saved_cs_client = @@character_set_client */;
  89. /*!40101 SET character_set_client = utf8 */;
  90. CREATE TABLE `jz_aftersale` (
  91. `id` int(11) NOT NULL AUTO_INCREMENT,
  92. `aftersale_sn` varchar(63) DEFAULT NULL COMMENT '售后编号',
  93. `order_id` int(11) NOT NULL COMMENT '订单ID',
  94. `user_id` int(11) NOT NULL COMMENT '用户ID',
  95. `type` smallint(6) DEFAULT '0' COMMENT '售后类型,0是未收货退款,1是已收货(无需退货)退款,2用户退货退款',
  96. `reason` varchar(31) DEFAULT '' COMMENT '退款原因',
  97. `amount` decimal(10,2) DEFAULT '0.00' COMMENT '退款金额',
  98. `pictures` varchar(1023) DEFAULT '[]' COMMENT '退款凭证图片链接数组',
  99. `comment` varchar(511) DEFAULT '' COMMENT '退款说明',
  100. `status` smallint(6) DEFAULT '0' COMMENT '售后状态,0是可申请,1是用户已申请,2是管理员审核通过,3是管理员退款成功,4是管理员审核拒绝,5是用户已取消',
  101. `handle_time` datetime DEFAULT NULL COMMENT '管理员操作时间',
  102. `add_time` datetime DEFAULT NULL COMMENT '添加时间',
  103. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  104. `deleted` tinyint(1) DEFAULT '0' COMMENT '售后编号',
  105. PRIMARY KEY (`id`)
  106. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='售后表';
  107. /*!40101 SET character_set_client = @saved_cs_client */;
  108. --
  109. -- Table structure for table `jz_brand`
  110. --
  111. DROP TABLE IF EXISTS `jz_brand`;
  112. /*!40101 SET @saved_cs_client = @@character_set_client */;
  113. /*!40101 SET character_set_client = utf8 */;
  114. CREATE TABLE `jz_brand` (
  115. `id` int(11) NOT NULL AUTO_INCREMENT,
  116. `name` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌商名称',
  117. `desc` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌商简介',
  118. `pic_url` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌商页的品牌商图片',
  119. `sort_order` tinyint(3) DEFAULT '50',
  120. `floor_price` decimal(10,2) DEFAULT '0.00' COMMENT '品牌商的商品低价,仅用于页面展示',
  121. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  122. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  123. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  124. PRIMARY KEY (`id`)
  125. ) ENGINE=InnoDB AUTO_INCREMENT=1046003 DEFAULT CHARSET=utf8mb4 COMMENT='品牌商表';
  126. /*!40101 SET character_set_client = @saved_cs_client */;
  127. --
  128. -- Table structure for table `jz_cart`
  129. --
  130. DROP TABLE IF EXISTS `jz_cart`;
  131. /*!40101 SET @saved_cs_client = @@character_set_client */;
  132. /*!40101 SET character_set_client = utf8 */;
  133. CREATE TABLE `jz_cart` (
  134. `id` int(11) NOT NULL AUTO_INCREMENT,
  135. `user_id` int(11) DEFAULT NULL COMMENT '用户表的用户ID',
  136. `goods_id` int(11) DEFAULT NULL COMMENT '商品表的商品ID',
  137. `goods_sn` varchar(63) DEFAULT NULL COMMENT '商品编号',
  138. `goods_name` varchar(127) DEFAULT NULL COMMENT '商品名称',
  139. `product_id` int(11) DEFAULT NULL COMMENT '商品货品表的货品ID',
  140. `price` decimal(10,2) DEFAULT '0.00' COMMENT '商品货品的价格',
  141. `number` smallint(5) DEFAULT '0' COMMENT '商品货品的数量',
  142. `specifications` varchar(1023) DEFAULT NULL COMMENT '商品规格值列表,采用JSON数组格式',
  143. `checked` tinyint(1) DEFAULT '1' COMMENT '购物车中商品是否选择状态',
  144. `pic_url` varchar(255) DEFAULT NULL COMMENT '商品图片或者商品货品图片',
  145. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  146. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  147. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  148. PRIMARY KEY (`id`)
  149. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='购物车商品表';
  150. /*!40101 SET character_set_client = @saved_cs_client */;
  151. --
  152. -- Table structure for table `jz_category`
  153. --
  154. DROP TABLE IF EXISTS `jz_category`;
  155. /*!40101 SET @saved_cs_client = @@character_set_client */;
  156. /*!40101 SET character_set_client = utf8 */;
  157. CREATE TABLE `jz_category` (
  158. `id` int(11) NOT NULL AUTO_INCREMENT,
  159. `name` varchar(63) NOT NULL DEFAULT '' COMMENT '类目名称',
  160. `keywords` varchar(1023) NOT NULL DEFAULT '' COMMENT '类目关键字,以JSON数组格式',
  161. `desc` varchar(255) DEFAULT '' COMMENT '类目广告语介绍',
  162. `pid` int(11) NOT NULL DEFAULT '0' COMMENT '父类目ID',
  163. `icon_url` varchar(255) DEFAULT '' COMMENT '类目图标',
  164. `pic_url` varchar(255) DEFAULT '' COMMENT '类目图片',
  165. `level` varchar(255) DEFAULT 'L1',
  166. `sort_order` tinyint(3) DEFAULT '50' COMMENT '排序',
  167. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  168. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  169. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  170. PRIMARY KEY (`id`),
  171. KEY `parent_id` (`pid`)
  172. ) ENGINE=InnoDB AUTO_INCREMENT=1036007 DEFAULT CHARSET=utf8mb4 COMMENT='类目表';
  173. /*!40101 SET character_set_client = @saved_cs_client */;
  174. --
  175. -- Table structure for table `jz_collect`
  176. --
  177. DROP TABLE IF EXISTS `jz_collect`;
  178. /*!40101 SET @saved_cs_client = @@character_set_client */;
  179. /*!40101 SET character_set_client = utf8 */;
  180. CREATE TABLE `jz_collect` (
  181. `id` int(11) NOT NULL AUTO_INCREMENT,
  182. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户表的用户ID',
  183. `value_id` int(11) NOT NULL DEFAULT '0' COMMENT '如果type=0,则是商品ID;如果type=1,则是专题ID',
  184. `type` tinyint(3) NOT NULL DEFAULT '0' COMMENT '收藏类型,如果type=0,则是商品ID;如果type=1,则是专题ID',
  185. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  186. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  187. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  188. PRIMARY KEY (`id`),
  189. KEY `user_id` (`user_id`),
  190. KEY `goods_id` (`value_id`)
  191. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收藏表';
  192. /*!40101 SET character_set_client = @saved_cs_client */;
  193. --
  194. -- Table structure for table `jz_comment`
  195. --
  196. DROP TABLE IF EXISTS `jz_comment`;
  197. /*!40101 SET @saved_cs_client = @@character_set_client */;
  198. /*!40101 SET character_set_client = utf8 */;
  199. CREATE TABLE `jz_comment` (
  200. `id` int(11) NOT NULL AUTO_INCREMENT,
  201. `value_id` int(11) NOT NULL DEFAULT '0' COMMENT '如果type=0,则是商品评论;如果是type=1,则是专题评论。',
  202. `type` tinyint(3) NOT NULL DEFAULT '0' COMMENT '评论类型,如果type=0,则是商品评论;如果是type=1,则是专题评论;',
  203. `content` varchar(1023) NOT NULL COMMENT '评论内容',
  204. `admin_content` varchar(511) NOT NULL COMMENT '管理员回复内容',
  205. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户表的用户ID',
  206. `has_picture` tinyint(1) DEFAULT '0' COMMENT '是否含有图片',
  207. `pic_urls` varchar(1023) DEFAULT NULL COMMENT '图片地址列表,采用JSON数组格式',
  208. `star` smallint(6) DEFAULT '1' COMMENT '评分, 1-5',
  209. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  210. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  211. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  212. PRIMARY KEY (`id`),
  213. KEY `id_value` (`value_id`)
  214. ) ENGINE=InnoDB AUTO_INCREMENT=1012 DEFAULT CHARSET=utf8mb4 COMMENT='评论表';
  215. /*!40101 SET character_set_client = @saved_cs_client */;
  216. --
  217. -- Table structure for table `jz_coupon`
  218. --
  219. DROP TABLE IF EXISTS `jz_coupon`;
  220. /*!40101 SET @saved_cs_client = @@character_set_client */;
  221. /*!40101 SET character_set_client = utf8 */;
  222. CREATE TABLE `jz_coupon` (
  223. `id` int(11) NOT NULL AUTO_INCREMENT,
  224. `name` varchar(63) NOT NULL COMMENT '优惠券名称',
  225. `desc` varchar(127) DEFAULT '' COMMENT '优惠券介绍,通常是显示优惠券使用限制文字',
  226. `tag` varchar(63) DEFAULT '' COMMENT '优惠券标签,例如新人专用',
  227. `total` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券数量,如果是0,则是无限量',
  228. `discount` decimal(10,2) DEFAULT '0.00' COMMENT '优惠金额,',
  229. `min` decimal(10,2) DEFAULT '0.00' COMMENT '最少消费金额才能使用优惠券。',
  230. `limit` smallint(6) DEFAULT '1' COMMENT '用户领券限制数量,如果是0,则是不限制;默认是1,限领一张.',
  231. `type` smallint(6) DEFAULT '0' COMMENT '优惠券赠送类型,如果是0则通用券,用户领取;如果是1,则是注册赠券;如果是2,则是优惠券码兑换;',
  232. `status` smallint(6) DEFAULT '0' COMMENT '优惠券状态,如果是0则是正常可用;如果是1则是过期; 如果是2则是下架。',
  233. `goods_type` smallint(6) DEFAULT '0' COMMENT '商品限制类型,如果0则全商品,如果是1则是类目限制,如果是2则是商品限制。',
  234. `goods_value` varchar(1023) DEFAULT '[]' COMMENT '商品限制值,goods_type如果是0则空集合,如果是1则是类目集合,如果是2则是商品集合。',
  235. `code` varchar(63) DEFAULT NULL COMMENT '优惠券兑换码',
  236. `time_type` smallint(6) DEFAULT '0' COMMENT '有效时间限制,如果是0,则基于领取时间的有效天数days;如果是1,则start_time和end_time是优惠券有效期;',
  237. `days` smallint(6) DEFAULT '0' COMMENT '基于领取时间的有效天数days。',
  238. `start_time` datetime DEFAULT NULL COMMENT '使用券开始时间',
  239. `end_time` datetime DEFAULT NULL COMMENT '使用券截至时间',
  240. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  241. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  242. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  243. PRIMARY KEY (`id`),
  244. KEY `code` (`code`)
  245. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='优惠券信息及规则表';
  246. /*!40101 SET character_set_client = @saved_cs_client */;
  247. --
  248. -- Table structure for table `jz_coupon_user`
  249. --
  250. DROP TABLE IF EXISTS `jz_coupon_user`;
  251. /*!40101 SET @saved_cs_client = @@character_set_client */;
  252. /*!40101 SET character_set_client = utf8 */;
  253. CREATE TABLE `jz_coupon_user` (
  254. `id` int(11) NOT NULL AUTO_INCREMENT,
  255. `user_id` int(11) NOT NULL COMMENT '用户ID',
  256. `coupon_id` int(11) NOT NULL COMMENT '优惠券ID',
  257. `status` smallint(6) DEFAULT '0' COMMENT '使用状态, 如果是0则未使用;如果是1则已使用;如果是2则已过期;如果是3则已经下架;',
  258. `used_time` datetime DEFAULT NULL COMMENT '使用时间',
  259. `start_time` datetime DEFAULT NULL COMMENT '有效期开始时间',
  260. `end_time` datetime DEFAULT NULL COMMENT '有效期截至时间',
  261. `order_id` int(11) DEFAULT NULL COMMENT '订单ID',
  262. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  263. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  264. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  265. PRIMARY KEY (`id`)
  266. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='优惠券用户使用表';
  267. /*!40101 SET character_set_client = @saved_cs_client */;
  268. --
  269. -- Table structure for table `jz_feedback`
  270. --
  271. DROP TABLE IF EXISTS `jz_feedback`;
  272. /*!40101 SET @saved_cs_client = @@character_set_client */;
  273. /*!40101 SET character_set_client = utf8 */;
  274. CREATE TABLE `jz_feedback` (
  275. `id` int(11) NOT NULL AUTO_INCREMENT,
  276. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户表的用户ID',
  277. `username` varchar(63) NOT NULL DEFAULT '' COMMENT '用户名称',
  278. `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号',
  279. `feed_type` varchar(63) NOT NULL DEFAULT '' COMMENT '反馈类型',
  280. `content` varchar(1023) NOT NULL COMMENT '反馈内容',
  281. `status` int(3) NOT NULL DEFAULT '0' COMMENT '状态',
  282. `has_picture` tinyint(1) DEFAULT '0' COMMENT '是否含有图片',
  283. `pic_urls` varchar(1023) DEFAULT NULL COMMENT '图片地址列表,采用JSON数组格式',
  284. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  285. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  286. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  287. PRIMARY KEY (`id`),
  288. KEY `id_value` (`status`)
  289. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='意见反馈表';
  290. /*!40101 SET character_set_client = @saved_cs_client */;
  291. --
  292. -- Table structure for table `jz_footprint`
  293. --
  294. DROP TABLE IF EXISTS `jz_footprint`;
  295. /*!40101 SET @saved_cs_client = @@character_set_client */;
  296. /*!40101 SET character_set_client = utf8 */;
  297. CREATE TABLE `jz_footprint` (
  298. `id` int(11) NOT NULL AUTO_INCREMENT,
  299. `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户表的用户ID',
  300. `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '浏览商品ID',
  301. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  302. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  303. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  304. PRIMARY KEY (`id`)
  305. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户浏览足迹表';
  306. /*!40101 SET character_set_client = @saved_cs_client */;
  307. --
  308. -- Table structure for table `jz_goods`
  309. --
  310. DROP TABLE IF EXISTS `jz_goods`;
  311. /*!40101 SET @saved_cs_client = @@character_set_client */;
  312. /*!40101 SET character_set_client = utf8 */;
  313. CREATE TABLE `jz_goods`(
  314. `id` int(11) NOT NULL AUTO_INCREMENT,
  315. `goods_sn` varchar(63) NOT NULL DEFAULT '' COMMENT '商品编号',
  316. `name` varchar(127) NOT NULL DEFAULT '' COMMENT '商品名称',
  317. `category_id` int(11) DEFAULT '0' COMMENT '商品所属类目ID',
  318. `brand_id` int(11) DEFAULT '0',
  319. `gallery` varchar(1023) DEFAULT NULL COMMENT '商品宣传图片列表,采用JSON数组格式',
  320. `keywords` varchar(255) DEFAULT '' COMMENT '商品关键字,采用逗号间隔',
  321. `brief` varchar(255) DEFAULT '' COMMENT '商品简介',
  322. `is_on_sale` tinyint(1) DEFAULT '1' COMMENT '是否上架',
  323. `sort_order` smallint(4) DEFAULT '100',
  324. `pic_url` varchar(255) DEFAULT NULL COMMENT '商品页面商品图片',
  325. `share_url` varchar(255) DEFAULT NULL COMMENT '商品分享朋友圈图片',
  326. `is_new` tinyint(1) DEFAULT '0' COMMENT '是否新品首发,如果设置则可以在新品首发页面展示',
  327. `is_hot` tinyint(1) DEFAULT '0' COMMENT '是否人气推荐,如果设置则可以在人气推荐页面展示',
  328. `unit` varchar(31) DEFAULT '’件‘' COMMENT '商品单位,例如件、盒',
  329. `counter_price` decimal(10,2) DEFAULT '0.00' COMMENT '专柜价格',
  330. `retail_price` decimal(10,2) DEFAULT '100000.00' COMMENT '零售价格',
  331. `detail` text COMMENT '商品详细介绍,是富文本格式',
  332. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  333. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  334. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  335. PRIMARY KEY (`id`),
  336. KEY `goods_sn` (`goods_sn`),
  337. KEY `cat_id` (`category_id`),
  338. KEY `brand_id` (`brand_id`),
  339. KEY `sort_order` (`sort_order`)
  340. ) ENGINE=InnoDB AUTO_INCREMENT=1181004 DEFAULT CHARSET=utf8mb4 COMMENT='商品基本信息表';
  341. /*!40101 SET character_set_client = @saved_cs_client */;
  342. --
  343. -- Table structure for table `jz_goods_attribute`
  344. --
  345. DROP TABLE IF EXISTS `jz_goods_attribute`;
  346. /*!40101 SET @saved_cs_client = @@character_set_client */;
  347. /*!40101 SET character_set_client = utf8 */;
  348. CREATE TABLE `jz_goods_attribute` (
  349. `id` int(11) NOT NULL AUTO_INCREMENT,
  350. `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品表的商品ID',
  351. `attribute` varchar(255) NOT NULL COMMENT '商品参数名称',
  352. `value` varchar(255) NOT NULL COMMENT '商品参数值',
  353. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  354. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  355. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  356. PRIMARY KEY (`id`),
  357. KEY `goods_id` (`goods_id`)
  358. ) ENGINE=InnoDB AUTO_INCREMENT=877 DEFAULT CHARSET=utf8mb4 COMMENT='商品参数表';
  359. /*!40101 SET character_set_client = @saved_cs_client */;
  360. --
  361. -- Table structure for table `jz_goods_product`
  362. --
  363. DROP TABLE IF EXISTS `jz_goods_product`;
  364. /*!40101 SET @saved_cs_client = @@character_set_client */;
  365. /*!40101 SET character_set_client = utf8 */;
  366. CREATE TABLE `jz_goods_product` (
  367. `id` int(11) NOT NULL AUTO_INCREMENT,
  368. `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品表的商品ID',
  369. `specifications` varchar(1023) NOT NULL COMMENT '商品规格值列表,采用JSON数组格式',
  370. `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品货品价格',
  371. `number` int(11) NOT NULL DEFAULT '0' COMMENT '商品货品数量',
  372. `url` varchar(125) DEFAULT NULL COMMENT '商品货品图片',
  373. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  374. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  375. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  376. PRIMARY KEY (`id`),
  377. KEY `goods_id` (`goods_id`)
  378. ) ENGINE=InnoDB AUTO_INCREMENT=251 DEFAULT CHARSET=utf8mb4 COMMENT='商品货品表';
  379. /*!40101 SET character_set_client = @saved_cs_client */;
  380. --
  381. -- Table structure for table `jz_goods_specification`
  382. --
  383. DROP TABLE IF EXISTS `jz_goods_specification`;
  384. /*!40101 SET @saved_cs_client = @@character_set_client */;
  385. /*!40101 SET character_set_client = utf8 */;
  386. CREATE TABLE `jz_goods_specification` (
  387. `id` int(11) NOT NULL AUTO_INCREMENT,
  388. `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品表的商品ID',
  389. `specification` varchar(255) NOT NULL DEFAULT '' COMMENT '商品规格名称',
  390. `value` varchar(255) NOT NULL DEFAULT '' COMMENT '商品规格值',
  391. `pic_url` varchar(255) NOT NULL DEFAULT '' COMMENT '商品规格图片',
  392. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  393. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  394. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  395. PRIMARY KEY (`id`),
  396. KEY `goods_id` (`goods_id`)
  397. ) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4 COMMENT='商品规格表';
  398. /*!40101 SET character_set_client = @saved_cs_client */;
  399. --
  400. -- Table structure for table `jz_groupon`
  401. --
  402. DROP TABLE IF EXISTS `jz_groupon`;
  403. /*!40101 SET @saved_cs_client = @@character_set_client */;
  404. /*!40101 SET character_set_client = utf8 */;
  405. CREATE TABLE `jz_groupon` (
  406. `id` int(11) NOT NULL AUTO_INCREMENT,
  407. `order_id` int(11) NOT NULL COMMENT '关联的订单ID',
  408. `groupon_id` int(11) DEFAULT '0' COMMENT '如果是开团用户,则groupon_id是0;如果是参团用户,则groupon_id是团购活动ID',
  409. `rules_id` int(11) NOT NULL COMMENT '团购规则ID,关联jz_groupon_rules表ID字段',
  410. `user_id` int(11) NOT NULL COMMENT '用户ID',
  411. `share_url` varchar(255) DEFAULT NULL COMMENT '团购分享图片地址',
  412. `creator_user_id` int(11) NOT NULL COMMENT '开团用户ID',
  413. `creator_user_time` datetime DEFAULT NULL COMMENT '开团时间',
  414. `status` smallint(6) DEFAULT '0' COMMENT '团购活动状态,开团未支付则0,开团中则1,开团失败则2',
  415. `add_time` datetime NOT NULL COMMENT '创建时间',
  416. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  417. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  418. PRIMARY KEY (`id`) USING BTREE
  419. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='团购活动表';
  420. /*!40101 SET character_set_client = @saved_cs_client */;
  421. --
  422. -- Table structure for table `jz_groupon_rules`
  423. --
  424. DROP TABLE IF EXISTS `jz_groupon_rules`;
  425. /*!40101 SET @saved_cs_client = @@character_set_client */;
  426. /*!40101 SET character_set_client = utf8 */;
  427. CREATE TABLE `jz_groupon_rules` (
  428. `id` int(11) NOT NULL AUTO_INCREMENT,
  429. `goods_id` int(11) NOT NULL COMMENT '商品表的商品ID',
  430. `goods_name` varchar(127) NOT NULL COMMENT '商品名称',
  431. `pic_url` varchar(255) DEFAULT NULL COMMENT '商品图片或者商品货品图片',
  432. `discount` decimal(63,0) NOT NULL COMMENT '优惠金额',
  433. `discount_member` int(11) NOT NULL COMMENT '达到优惠条件的人数',
  434. `expire_time` datetime DEFAULT NULL COMMENT '团购过期时间',
  435. `status` smallint(6) DEFAULT '0' COMMENT '团购规则状态,正常上线则0,到期自动下线则1,管理手动下线则2',
  436. `add_time` datetime NOT NULL COMMENT '创建时间',
  437. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  438. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  439. PRIMARY KEY (`id`) USING BTREE,
  440. KEY `goods_id` (`goods_id`)
  441. ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='团购规则表';
  442. /*!40101 SET character_set_client = @saved_cs_client */;
  443. --
  444. -- Table structure for table `jz_issue`
  445. --
  446. DROP TABLE IF EXISTS `jz_issue`;
  447. /*!40101 SET @saved_cs_client = @@character_set_client */;
  448. /*!40101 SET character_set_client = utf8 */;
  449. CREATE TABLE `jz_issue` (
  450. `id` int(11) NOT NULL AUTO_INCREMENT,
  451. `question` varchar(255) DEFAULT NULL COMMENT '问题标题',
  452. `answer` varchar(255) DEFAULT NULL COMMENT '问题答案',
  453. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  454. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  455. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  456. PRIMARY KEY (`id`)
  457. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='常见问题表';
  458. /*!40101 SET character_set_client = @saved_cs_client */;
  459. --
  460. -- Table structure for table `jz_keyword`
  461. --
  462. DROP TABLE IF EXISTS `jz_keyword`;
  463. /*!40101 SET @saved_cs_client = @@character_set_client */;
  464. /*!40101 SET character_set_client = utf8 */;
  465. CREATE TABLE `jz_keyword` (
  466. `id` int(11) NOT NULL AUTO_INCREMENT,
  467. `keyword` varchar(127) NOT NULL DEFAULT '' COMMENT '关键字',
  468. `url` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字的跳转链接',
  469. `is_hot` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否是热门关键字',
  470. `is_default` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否是默认关键字',
  471. `sort_order` int(11) NOT NULL DEFAULT '100' COMMENT '排序',
  472. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  473. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  474. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  475. PRIMARY KEY (`id`)
  476. ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COMMENT='关键字表';
  477. /*!40101 SET character_set_client = @saved_cs_client */;
  478. --
  479. -- Table structure for table `jz_log`
  480. --
  481. DROP TABLE IF EXISTS `jz_log`;
  482. /*!40101 SET @saved_cs_client = @@character_set_client */;
  483. /*!40101 SET character_set_client = utf8 */;
  484. CREATE TABLE `jz_log` (
  485. `id` int(11) NOT NULL AUTO_INCREMENT,
  486. `admin` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '管理员',
  487. `ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '管理员地址',
  488. `type` int(11) DEFAULT NULL COMMENT '操作分类',
  489. `action` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作动作',
  490. `status` tinyint(1) DEFAULT NULL COMMENT '操作状态',
  491. `result` varchar(127) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作结果,或者成功消息,或者失败消息',
  492. `comment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '补充信息',
  493. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  494. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  495. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  496. PRIMARY KEY (`id`)
  497. ) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='操作日志表';
  498. /*!40101 SET character_set_client = @saved_cs_client */;
  499. --
  500. -- Table structure for table `jz_notice`
  501. --
  502. DROP TABLE IF EXISTS `jz_notice`;
  503. /*!40101 SET @saved_cs_client = @@character_set_client */;
  504. /*!40101 SET character_set_client = utf8 */;
  505. CREATE TABLE `jz_notice` (
  506. `id` int(11) NOT NULL AUTO_INCREMENT,
  507. `title` varchar(63) DEFAULT NULL COMMENT '通知标题',
  508. `content` varchar(511) DEFAULT NULL COMMENT '通知内容',
  509. `admin_id` int(11) DEFAULT '0' COMMENT '创建通知的管理员ID,如果是系统内置通知则是0.',
  510. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  511. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  512. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  513. PRIMARY KEY (`id`)
  514. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='通知表';
  515. /*!40101 SET character_set_client = @saved_cs_client */;
  516. --
  517. -- Table structure for table `jz_notice_admin`
  518. --
  519. DROP TABLE IF EXISTS `jz_notice_admin`;
  520. /*!40101 SET @saved_cs_client = @@character_set_client */;
  521. /*!40101 SET character_set_client = utf8 */;
  522. CREATE TABLE `jz_notice_admin` (
  523. `id` int(11) NOT NULL AUTO_INCREMENT,
  524. `notice_id` int(11) DEFAULT NULL COMMENT '通知ID',
  525. `notice_title` varchar(63) DEFAULT NULL COMMENT '通知标题',
  526. `admin_id` int(11) DEFAULT NULL COMMENT '接收通知的管理员ID',
  527. `read_time` datetime DEFAULT NULL COMMENT '阅读时间,如果是NULL则是未读状态',
  528. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  529. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  530. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  531. PRIMARY KEY (`id`)
  532. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='通知管理员表';
  533. /*!40101 SET character_set_client = @saved_cs_client */;
  534. --
  535. -- Table structure for table `jz_order`
  536. --
  537. DROP TABLE IF EXISTS `jz_order`;
  538. /*!40101 SET @saved_cs_client = @@character_set_client */;
  539. /*!40101 SET character_set_client = utf8 */;
  540. CREATE TABLE `jz_order` (
  541. `id` int(11) NOT NULL AUTO_INCREMENT,
  542. `user_id` int(11) NOT NULL COMMENT '用户表的用户ID',
  543. `order_sn` varchar(63) NOT NULL COMMENT '订单编号',
  544. `order_status` smallint(6) NOT NULL COMMENT '订单状态',
  545. `aftersale_status` smallint(6) DEFAULT '0' COMMENT '售后状态,0是可申请,1是用户已申请,2是管理员审核通过,3是管理员退款成功,4是管理员审核拒绝,5是用户已取消',
  546. `consignee` varchar(63) NOT NULL COMMENT '收货人名称',
  547. `mobile` varchar(63) NOT NULL COMMENT '收货人手机号',
  548. `address` varchar(127) NOT NULL COMMENT '收货具体地址',
  549. `message` varchar(512) NOT NULL DEFAULT '' COMMENT '用户订单留言',
  550. `goods_price` decimal(10,2) NOT NULL COMMENT '商品总费用',
  551. `freight_price` decimal(10,2) NOT NULL COMMENT '配送费用',
  552. `coupon_price` decimal(10,2) NOT NULL COMMENT '优惠券减免',
  553. `integral_price` decimal(10,2) NOT NULL COMMENT '用户积分减免',
  554. `groupon_price` decimal(10,2) NOT NULL COMMENT '团购优惠价减免',
  555. `order_price` decimal(10,2) NOT NULL COMMENT '订单费用, = goods_price + freight_price - coupon_price',
  556. `actual_price` decimal(10,2) NOT NULL COMMENT '实付费用, = order_price - integral_price',
  557. `pay_id` varchar(63) DEFAULT NULL COMMENT '微信付款编号',
  558. `pay_time` datetime DEFAULT NULL COMMENT '微信付款时间',
  559. `ship_sn` varchar(63) DEFAULT NULL COMMENT '发货编号',
  560. `ship_channel` varchar(63) DEFAULT NULL COMMENT '发货快递公司',
  561. `ship_time` datetime DEFAULT NULL COMMENT '发货开始时间',
  562. `refund_amount` decimal(10,2) DEFAULT NULL COMMENT '实际退款金额,(有可能退款金额小于实际支付金额)',
  563. `refund_type` varchar(63) DEFAULT NULL COMMENT '退款方式',
  564. `refund_content` varchar(127) DEFAULT NULL COMMENT '退款备注',
  565. `refund_time` datetime DEFAULT NULL COMMENT '退款时间',
  566. `confirm_time` datetime DEFAULT NULL COMMENT '用户确认收货时间',
  567. `comments` smallint(6) DEFAULT '0' COMMENT '待评价订单商品数量',
  568. `end_time` datetime DEFAULT NULL COMMENT '订单关闭时间',
  569. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  570. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  571. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  572. PRIMARY KEY (`id`)
  573. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单表';
  574. /*!40101 SET character_set_client = @saved_cs_client */;
  575. --
  576. -- Table structure for table `jz_order_goods`
  577. --
  578. DROP TABLE IF EXISTS `jz_order_goods`;
  579. /*!40101 SET @saved_cs_client = @@character_set_client */;
  580. /*!40101 SET character_set_client = utf8 */;
  581. CREATE TABLE `jz_order_goods` (
  582. `id` int(11) NOT NULL AUTO_INCREMENT,
  583. `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单表的订单ID',
  584. `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品表的商品ID',
  585. `goods_name` varchar(127) NOT NULL DEFAULT '' COMMENT '商品名称',
  586. `goods_sn` varchar(63) NOT NULL DEFAULT '' COMMENT '商品编号',
  587. `product_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品货品表的货品ID',
  588. `number` smallint(5) NOT NULL DEFAULT '0' COMMENT '商品货品的购买数量',
  589. `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品货品的售价',
  590. `specifications` varchar(1023) NOT NULL COMMENT '商品货品的规格列表',
  591. `pic_url` varchar(255) NOT NULL DEFAULT '' COMMENT '商品货品图片或者商品图片',
  592. `comment` int(11) DEFAULT '0' COMMENT '订单商品评论,如果是-1,则超期不能评价;如果是0,则可以评价;如果其他值,则是comment表里面的评论ID。',
  593. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  594. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  595. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  596. PRIMARY KEY (`id`),
  597. KEY `order_id` (`order_id`),
  598. KEY `goods_id` (`goods_id`)
  599. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单商品表';
  600. /*!40101 SET character_set_client = @saved_cs_client */;
  601. --
  602. -- Table structure for table `jz_permission`
  603. --
  604. DROP TABLE IF EXISTS `jz_permission`;
  605. /*!40101 SET @saved_cs_client = @@character_set_client */;
  606. /*!40101 SET character_set_client = utf8 */;
  607. CREATE TABLE `jz_permission` (
  608. `id` int(11) NOT NULL AUTO_INCREMENT,
  609. `role_id` int(11) DEFAULT NULL COMMENT '角色ID',
  610. `permission` varchar(63) DEFAULT NULL COMMENT '权限',
  611. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  612. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  613. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  614. PRIMARY KEY (`id`)
  615. ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COMMENT='权限表';
  616. /*!40101 SET character_set_client = @saved_cs_client */;
  617. --
  618. -- Table structure for table `jz_region`
  619. --
  620. DROP TABLE IF EXISTS `jz_region`;
  621. /*!40101 SET @saved_cs_client = @@character_set_client */;
  622. /*!40101 SET character_set_client = utf8 */;
  623. CREATE TABLE `jz_region` (
  624. `id` int(11) NOT NULL AUTO_INCREMENT,
  625. `pid` int(11) NOT NULL DEFAULT '0' COMMENT '行政区域父ID,例如区县的pid指向市,市的pid指向省,省的pid则是0',
  626. `name` varchar(120) NOT NULL DEFAULT '' COMMENT '行政区域名称',
  627. `type` tinyint(3) NOT NULL DEFAULT '0' COMMENT '行政区域类型,如如1则是省, 如果是2则是市,如果是3则是区县',
  628. `code` int(11) NOT NULL DEFAULT '0' COMMENT '行政区域编码',
  629. PRIMARY KEY (`id`),
  630. KEY `parent_id` (`pid`),
  631. KEY `region_type` (`type`),
  632. KEY `agency_id` (`code`)
  633. ) ENGINE=InnoDB AUTO_INCREMENT=3232 DEFAULT CHARSET=utf8mb4 COMMENT='行政区域表';
  634. /*!40101 SET character_set_client = @saved_cs_client */;
  635. --
  636. -- Table structure for table `jz_role`
  637. --
  638. DROP TABLE IF EXISTS `jz_role`;
  639. /*!40101 SET @saved_cs_client = @@character_set_client */;
  640. /*!40101 SET character_set_client = utf8 */;
  641. CREATE TABLE `jz_role` (
  642. `id` int(11) NOT NULL AUTO_INCREMENT,
  643. `name` varchar(63) NOT NULL COMMENT '角色名称',
  644. `desc` varchar(1023) DEFAULT NULL COMMENT '角色描述',
  645. `enabled` tinyint(1) DEFAULT '1' COMMENT '是否启用',
  646. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  647. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  648. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  649. PRIMARY KEY (`id`),
  650. UNIQUE KEY `name_UNIQUE` (`name`)
  651. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='角色表';
  652. /*!40101 SET character_set_client = @saved_cs_client */;
  653. --
  654. -- Table structure for table `jz_search_history`
  655. --
  656. DROP TABLE IF EXISTS `jz_search_history`;
  657. /*!40101 SET @saved_cs_client = @@character_set_client */;
  658. /*!40101 SET character_set_client = utf8 */;
  659. CREATE TABLE `jz_search_history` (
  660. `id` int(11) NOT NULL AUTO_INCREMENT,
  661. `user_id` int(11) NOT NULL COMMENT '用户表的用户ID',
  662. `keyword` varchar(63) NOT NULL COMMENT '搜索关键字',
  663. `from` varchar(63) NOT NULL DEFAULT '' COMMENT '搜索来源,如pc、wx、app',
  664. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  665. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  666. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  667. PRIMARY KEY (`id`)
  668. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='搜索历史表';
  669. /*!40101 SET character_set_client = @saved_cs_client */;
  670. --
  671. -- Table structure for table `jz_storage`
  672. --
  673. DROP TABLE IF EXISTS `jz_storage`;
  674. /*!40101 SET @saved_cs_client = @@character_set_client */;
  675. /*!40101 SET character_set_client = utf8 */;
  676. CREATE TABLE `jz_storage` (
  677. `id` int(11) NOT NULL AUTO_INCREMENT,
  678. `key` varchar(63) NOT NULL COMMENT '文件的唯一索引',
  679. `name` varchar(255) NOT NULL COMMENT '文件名',
  680. `type` varchar(20) NOT NULL COMMENT '文件类型',
  681. `size` int(11) NOT NULL COMMENT '文件大小',
  682. `url` varchar(255) DEFAULT NULL COMMENT '文件访问链接',
  683. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  684. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  685. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  686. PRIMARY KEY (`id`),
  687. KEY `key` (`key`)
  688. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件存储表';
  689. /*!40101 SET character_set_client = @saved_cs_client */;
  690. --
  691. -- Table structure for table `jz_system`
  692. --
  693. DROP TABLE IF EXISTS `jz_system`;
  694. /*!40101 SET @saved_cs_client = @@character_set_client */;
  695. /*!40101 SET character_set_client = utf8 */;
  696. CREATE TABLE `jz_system` (
  697. `id` int(11) NOT NULL AUTO_INCREMENT,
  698. `key_name` varchar(255) NOT NULL COMMENT '系统配置名',
  699. `key_value` varchar(255) NOT NULL COMMENT '系统配置值',
  700. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  701. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  702. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  703. PRIMARY KEY (`id`) USING BTREE
  704. ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='系统配置表';
  705. /*!40101 SET character_set_client = @saved_cs_client */;
  706. --
  707. -- Table structure for table `jz_topic`
  708. --
  709. DROP TABLE IF EXISTS `jz_topic`;
  710. /*!40101 SET @saved_cs_client = @@character_set_client */;
  711. /*!40101 SET character_set_client = utf8 */;
  712. CREATE TABLE `jz_topic` (
  713. `id` int(11) NOT NULL AUTO_INCREMENT,
  714. `title` varchar(255) NOT NULL DEFAULT '''' COMMENT '专题标题',
  715. `subtitle` varchar(255) DEFAULT '''' COMMENT '专题子标题',
  716. `content` text COMMENT '专题内容,富文本格式',
  717. `price` decimal(10,2) DEFAULT '0.00' COMMENT '专题相关商品最低价',
  718. `read_count` varchar(255) DEFAULT '1k' COMMENT '专题阅读量',
  719. `pic_url` varchar(255) DEFAULT '' COMMENT '专题图片',
  720. `sort_order` int(11) DEFAULT '100' COMMENT '排序',
  721. `goods` varchar(1023) DEFAULT '' COMMENT '专题相关商品,采用JSON数组格式',
  722. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  723. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  724. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  725. PRIMARY KEY (`id`),
  726. KEY `topic_id` (`id`)
  727. ) ENGINE=InnoDB AUTO_INCREMENT=319 DEFAULT CHARSET=utf8mb4 COMMENT='专题表';
  728. /*!40101 SET character_set_client = @saved_cs_client */;
  729. --
  730. -- Table structure for table `jz_user`
  731. --
  732. DROP TABLE IF EXISTS `jz_user`;
  733. /*!40101 SET @saved_cs_client = @@character_set_client */;
  734. /*!40101 SET character_set_client = utf8 */;
  735. CREATE TABLE `jz_user` (
  736. `id` int(11) NOT NULL AUTO_INCREMENT,
  737. `username` varchar(63) NOT NULL COMMENT '用户名称',
  738. `password` varchar(63) NOT NULL DEFAULT '' COMMENT '用户密码',
  739. `gender` tinyint(3) NOT NULL DEFAULT '0' COMMENT '性别:0 未知, 1男, 1 女',
  740. `birthday` date DEFAULT NULL COMMENT '生日',
  741. `last_login_time` datetime DEFAULT NULL COMMENT '最近一次登录时间',
  742. `last_login_ip` varchar(63) NOT NULL DEFAULT '' COMMENT '最近一次登录IP地址',
  743. `user_level` tinyint(3) DEFAULT '0' COMMENT '0 普通用户,1 VIP用户,2 高级VIP用户',
  744. `nickname` varchar(63) NOT NULL DEFAULT '' COMMENT '用户昵称或网络名称',
  745. `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '用户手机号码',
  746. `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '用户头像图片',
  747. `weixin_openid` varchar(63) NOT NULL DEFAULT '' COMMENT '微信登录openid',
  748. `session_key` varchar(100) NOT NULL DEFAULT '' COMMENT '微信登录会话KEY',
  749. `status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '0 可用, 1 禁用, 2 注销',
  750. `add_time` datetime DEFAULT NULL COMMENT '创建时间',
  751. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  752. `deleted` tinyint(1) DEFAULT '0' COMMENT '逻辑删除',
  753. PRIMARY KEY (`id`),
  754. UNIQUE KEY `user_name` (`username`)
  755. ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
  756. /*!40101 SET character_set_client = @saved_cs_client */;
  757. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  758. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  759. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  760. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  761. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  762. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  763. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  764. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  765. -- Dump completed on 2019-12-16 23:12:57