shopxo.sql 101.6 KB
Newer Older
D
v1.2.0  
devil_gong 已提交
1
/*
D
devil_gong 已提交
2
 Navicat Premium Data Transfer
D
v1.2.0  
devil_gong 已提交
3 4

 Source Server         : 本机
D
devil_gong 已提交
5
 Source Server Type    : MySQL
D
Devil 已提交
6
 Source Server Version : 50728
D
Devil 已提交
7 8
 Source Host           : localhost:3306
 Source Schema         : shopxo
D
v1.2.0  
devil_gong 已提交
9

D
devil_gong 已提交
10
 Target Server Type    : MySQL
D
Devil 已提交
11
 Target Server Version : 50728
D
Devil 已提交
12
 File Encoding         : 65001
D
v1.2.0  
devil_gong 已提交
13

D
Devil 已提交
14
 Date: 22/12/2020 15:31:20
D
v1.2.0  
devil_gong 已提交
15 16
*/

D
devil_gong 已提交
17
SET NAMES utf8mb4;
D
v1.2.0  
devil_gong 已提交
18 19 20
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
D
Devil 已提交
21
-- Table structure for s_admin
D
v1.2.0  
devil_gong 已提交
22 23 24 25 26 27 28 29 30
-- ----------------------------
DROP TABLE IF EXISTS `s_admin`;
CREATE TABLE `s_admin` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '管理员id',
  `username` char(30) NOT NULL DEFAULT '' COMMENT '用户名',
  `login_pwd` char(32) NOT NULL DEFAULT '' COMMENT '登录密码',
  `login_salt` char(6) NOT NULL DEFAULT '' COMMENT '登录密码配合加密字符串',
  `mobile` char(11) NOT NULL DEFAULT '' COMMENT '手机号码',
  `gender` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别(0保密,1女,2男)',
D
devil 已提交
31
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0正常, 1无效)',
D
v1.2.0  
devil_gong 已提交
32 33 34 35 36 37
  `login_total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
  `login_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间',
  `role_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所属角色组',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
D
sql  
devil 已提交
38
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='管理员';
D
v1.2.0  
devil_gong 已提交
39 40

-- ----------------------------
D
Devil 已提交
41
-- Table structure for s_answer
D
v1.2.0  
devil_gong 已提交
42 43 44 45 46 47 48
-- ----------------------------
DROP TABLE IF EXISTS `s_answer`;
CREATE TABLE `s_answer` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `name` char(30) NOT NULL DEFAULT '' COMMENT '联系人',
  `tel` char(20) NOT NULL DEFAULT '' COMMENT '联系电话',
D
devil_gong 已提交
49
  `title` char(60) NOT NULL DEFAULT '' COMMENT '标题',
G
gongfuxiang 已提交
50 51 52
  `content` text COMMENT '详细内容',
  `reply` text COMMENT '回复内容',
  `is_reply` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否已回复(0否, 1是)',
53
  `reply_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '回复时间',
D
v1.2.0  
devil_gong 已提交
54
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否显示(0不显示, 1显示)',
55
  `access_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '访问次数',
D
v1.2.0  
devil_gong 已提交
56 57 58 59 60
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`name`),
  KEY `is_show` (`is_show`)
D
v1.9.1  
devil 已提交
61
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户留言/问答';
D
v1.2.0  
devil_gong 已提交
62

D
devil_gong 已提交
63
-- ----------------------------
D
Devil 已提交
64
-- Table structure for s_app_center_nav
D
devil_gong 已提交
65 66 67 68
-- ----------------------------
DROP TABLE IF EXISTS `s_app_center_nav`;
CREATE TABLE `s_app_center_nav` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
D
sql  
devil 已提交
69
  `platform` char(30) NOT NULL DEFAULT 'pc' COMMENT '所属平台(pc PC网站, h5 H5手机网站, ios 苹果APP, android 安卓APP, alipay 支付宝小程序, weixin 微信小程序, baidu 百度小程序, toutiao 头条小程序, qq QQ小程序)',
D
devil_gong 已提交
70 71 72
  `event_type` tinyint(2) NOT NULL DEFAULT '-1' COMMENT '事件类型(0 WEB页面, 1 内部页面(小程序或APP内部地址), 2 外部小程序(同一个主体下的小程序appid), 3 打开地图, 4 拨打电话)',
  `event_value` char(255) NOT NULL DEFAULT '' COMMENT '事件值',
  `images_url` char(255) NOT NULL DEFAULT '' COMMENT '图片地址',
D
sql  
devil 已提交
73
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
D
devil_gong 已提交
74 75 76 77 78 79 80 81 82 83
  `desc` char(18) NOT NULL DEFAULT '' COMMENT '描述',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `is_need_login` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否需要登录(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `platform` (`platform`),
  KEY `is_enable` (`is_enable`),
  KEY `sort` (`sort`)
D
Devil 已提交
84
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='手机 - 用户中心导航';
D
devil_gong 已提交
85

D
v1.2.0  
devil_gong 已提交
86
-- ----------------------------
D
Devil 已提交
87
-- Table structure for s_app_home_nav
D
v1.2.0  
devil_gong 已提交
88 89 90 91
-- ----------------------------
DROP TABLE IF EXISTS `s_app_home_nav`;
CREATE TABLE `s_app_home_nav` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
D
sql  
devil 已提交
92
  `platform` char(30) NOT NULL DEFAULT 'pc' COMMENT '所属平台(pc PC网站, h5 H5手机网站, ios 苹果APP, android 安卓APP, alipay 支付宝小程序, weixin 微信小程序, baidu 百度小程序, toutiao 头条小程序, qq QQ小程序)',
D
v1.2.0  
devil_gong 已提交
93 94 95
  `event_type` tinyint(2) NOT NULL DEFAULT '-1' COMMENT '事件类型(0 WEB页面, 1 内部页面(小程序或APP内部地址), 2 外部小程序(同一个主体下的小程序appid), 3 打开地图, 4 拨打电话)',
  `event_value` char(255) NOT NULL DEFAULT '' COMMENT '事件值',
  `images_url` char(255) NOT NULL DEFAULT '' COMMENT '图片地址',
D
sql  
devil 已提交
96
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
D
v1.2.0  
devil_gong 已提交
97
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
D
devil_gong 已提交
98
  `is_need_login` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否需要登录(0否,1是)',
D
v1.2.0  
devil_gong 已提交
99 100 101 102 103 104 105 106
  `bg_color` char(30) NOT NULL DEFAULT '' COMMENT 'css背景色值',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `platform` (`platform`),
  KEY `is_enable` (`is_enable`),
  KEY `sort` (`sort`)
D
sql  
devil 已提交
107
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='手机 - 首页导航';
D
v1.2.0  
devil_gong 已提交
108 109

-- ----------------------------
D
Devil 已提交
110
-- Table structure for s_article
D
v1.2.0  
devil_gong 已提交
111 112 113 114 115 116 117 118 119
-- ----------------------------
DROP TABLE IF EXISTS `s_article`;
CREATE TABLE `s_article` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `title` char(60) NOT NULL DEFAULT '' COMMENT '标题',
  `article_category_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '文章分类',
  `title_color` char(7) NOT NULL DEFAULT '' COMMENT '标题颜色',
  `jump_url` char(255) NOT NULL DEFAULT '' COMMENT '跳转url地址',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
D
devil 已提交
120
  `content` longtext COMMENT '内容',
D
devil_gong 已提交
121 122
  `images` text COMMENT '图片数据(一维数组json)',
  `images_count` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '图片数量',
D
v1.2.0  
devil_gong 已提交
123 124
  `access_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '访问次数',
  `is_home_recommended` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '是否首页推荐(0否, 1是)',
G
gongfuxiang 已提交
125 126 127
  `seo_title` char(100) NOT NULL DEFAULT '' COMMENT 'SEO标题',
  `seo_keywords` char(130) NOT NULL DEFAULT '' COMMENT 'SEO关键字',
  `seo_desc` char(230) NOT NULL DEFAULT '' COMMENT 'SEO描述',
D
v1.2.0  
devil_gong 已提交
128 129 130 131 132 133
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `title` (`title`),
  KEY `is_enable` (`is_enable`),
  KEY `access_count` (`access_count`),
D
devil_gong 已提交
134
  KEY `image_count` (`images_count`),
D
v1.2.0  
devil_gong 已提交
135
  KEY `article_category_id` (`article_category_id`)
D
sql  
devil 已提交
136
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='文章';
D
v1.2.0  
devil_gong 已提交
137 138

-- ----------------------------
D
Devil 已提交
139
-- Table structure for s_article_category
D
v1.2.0  
devil_gong 已提交
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
-- ----------------------------
DROP TABLE IF EXISTS `s_article_category`;
CREATE TABLE `s_article_category` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类id',
  `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
  `name` char(30) CHARACTER SET utf8 NOT NULL COMMENT '名称',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '顺序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `pid` (`pid`),
  KEY `is_enable` (`is_enable`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='文章分类';

-- ----------------------------
D
Devil 已提交
156
-- Table structure for s_attachment
D
devil_gong 已提交
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
-- ----------------------------
DROP TABLE IF EXISTS `s_attachment`;
CREATE TABLE `s_attachment` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `title` char(160) NOT NULL DEFAULT '' COMMENT '名称',
  `original` char(160) NOT NULL DEFAULT '' COMMENT '原始名称',
  `path_type` char(80) NOT NULL DEFAULT '' COMMENT '路径标记',
  `size` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '大小(单位kb)',
  `ext` char(30) NOT NULL DEFAULT '' COMMENT '类型(后缀名)',
  `type` char(30) NOT NULL DEFAULT '' COMMENT '类型(file文件, image图片, scrawl涂鸦, video视频, remote远程抓取文件)',
  `url` char(255) NOT NULL DEFAULT '' COMMENT 'url路径',
  `hash` text COMMENT 'hash值',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `path_type` (`path_type`),
  KEY `type` (`type`)
D
Devil 已提交
173
) ENGINE=InnoDB AUTO_INCREMENT=599 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='附件';
D
devil_gong 已提交
174 175

-- ----------------------------
D
Devil 已提交
176
-- Table structure for s_brand
D
v1.2.0  
devil_gong 已提交
177 178 179 180 181 182 183 184 185
-- ----------------------------
DROP TABLE IF EXISTS `s_brand`;
CREATE TABLE `s_brand` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `logo` char(255) NOT NULL DEFAULT '' COMMENT 'logo图标',
  `name` char(30) NOT NULL COMMENT '名称',
  `website_url` char(255) NOT NULL DEFAULT '' COMMENT '官网地址',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '顺序',
D
devil_gong 已提交
186 187 188
  `seo_title` char(100) NOT NULL DEFAULT '' COMMENT 'SEO标题',
  `seo_keywords` char(130) NOT NULL DEFAULT '' COMMENT 'SEO关键字',
  `seo_desc` char(230) NOT NULL DEFAULT '' COMMENT 'SEO描述',
D
v1.2.0  
devil_gong 已提交
189 190 191 192
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `is_enable` (`is_enable`)
193
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='品牌';
D
v1.2.0  
devil_gong 已提交
194 195

-- ----------------------------
D
Devil 已提交
196
-- Table structure for s_brand_category
D
v1.2.0  
devil_gong 已提交
197 198 199 200 201 202 203 204 205 206 207 208 209 210
-- ----------------------------
DROP TABLE IF EXISTS `s_brand_category`;
CREATE TABLE `s_brand_category` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类id',
  `name` char(30) CHARACTER SET utf8 NOT NULL COMMENT '名称',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '顺序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `is_enable` (`is_enable`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='品牌分类';

-- ----------------------------
D
Devil 已提交
211
-- Table structure for s_brand_category_join
D
devil 已提交
212 213 214 215 216 217 218 219 220 221
-- ----------------------------
DROP TABLE IF EXISTS `s_brand_category_join`;
CREATE TABLE `s_brand_category_join` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `brand_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '品牌id',
  `brand_category_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分类id',
  `add_time` int(11) unsigned DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `brand_id` (`brand_id`),
  KEY `brand_category_id` (`brand_category_id`)
D
sql  
devil 已提交
222
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='品牌分类关联';
D
devil 已提交
223 224

-- ----------------------------
D
Devil 已提交
225
-- Table structure for s_cart
D
v1.2.0  
devil_gong 已提交
226 227 228 229 230 231 232 233 234 235 236
-- ----------------------------
DROP TABLE IF EXISTS `s_cart`;
CREATE TABLE `s_cart` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned DEFAULT '0' COMMENT '用户id',
  `goods_id` int(11) unsigned DEFAULT '0' COMMENT '商品id',
  `title` char(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '标题',
  `images` char(255) NOT NULL DEFAULT '' COMMENT '封面图片',
  `original_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '原价',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '销售价格',
  `stock` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '购买数量',
D
sql  
devil_gong 已提交
237
  `spec` text COMMENT '规格',
D
v1.2.0  
devil_gong 已提交
238 239 240 241 242 243 244
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `goods_id` (`goods_id`),
  KEY `title` (`title`),
  KEY `stock` (`stock`)
D
Devil 已提交
245
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='购物车';
D
v1.2.0  
devil_gong 已提交
246 247

-- ----------------------------
D
Devil 已提交
248
-- Table structure for s_config
D
v1.2.0  
devil_gong 已提交
249 250 251 252 253 254 255 256 257 258 259 260 261
-- ----------------------------
DROP TABLE IF EXISTS `s_config`;
CREATE TABLE `s_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '基本设置id',
  `value` text COMMENT '值',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
  `describe` char(255) NOT NULL DEFAULT '' COMMENT '描述',
  `error_tips` char(150) NOT NULL DEFAULT '' COMMENT '错误提示',
  `type` char(30) NOT NULL DEFAULT '' COMMENT '类型(admin后台, home前台)',
  `only_tag` char(60) NOT NULL DEFAULT '' COMMENT '唯一的标记',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `only_tag` (`only_tag`)
262
) ENGINE=MyISAM AUTO_INCREMENT=201 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='基本配置参数';
D
v1.2.0  
devil_gong 已提交
263 264

-- ----------------------------
D
Devil 已提交
265
-- Table structure for s_custom_view
D
v1.2.0  
devil_gong 已提交
266 267 268 269 270
-- ----------------------------
DROP TABLE IF EXISTS `s_custom_view`;
CREATE TABLE `s_custom_view` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `title` char(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '标题',
D
devil 已提交
271
  `content` longtext COMMENT '内容',
D
v1.2.0  
devil_gong 已提交
272 273 274 275
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `is_header` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否包含头部(0否, 1是)',
  `is_footer` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否包含尾部(0否, 1是)',
  `is_full_screen` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否满屏(0否, 1是)',
D
devil_gong 已提交
276 277
  `images` text COMMENT '图片数据(一维数组json)',
  `images_count` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '图片数量',
D
v1.2.0  
devil_gong 已提交
278 279 280 281 282 283 284
  `access_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '访问次数',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `title` (`title`),
  KEY `is_enable` (`is_enable`),
  KEY `access_count` (`access_count`),
D
devil_gong 已提交
285
  KEY `image_count` (`images_count`)
D
v1.9.1  
devil 已提交
286
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='自定义页面';
D
v1.2.0  
devil_gong 已提交
287 288

-- ----------------------------
D
Devil 已提交
289
-- Table structure for s_express
D
v1.2.0  
devil_gong 已提交
290 291 292 293 294 295 296 297 298 299 300 301 302
-- ----------------------------
DROP TABLE IF EXISTS `s_express`;
CREATE TABLE `s_express` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
  `icon` char(255) NOT NULL DEFAULT '' COMMENT 'icon图标',
  `name` char(30) NOT NULL COMMENT '名称',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '顺序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `is_enable` (`is_enable`)
D
sql  
devil 已提交
303
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='快递公司';
D
v1.2.0  
devil_gong 已提交
304 305

-- ----------------------------
D
Devil 已提交
306
-- Table structure for s_form_table_user_fields
D
devil 已提交
307 308 309 310 311 312 313 314 315 316 317 318 319 320
-- ----------------------------
DROP TABLE IF EXISTS `s_form_table_user_fields`;
CREATE TABLE `s_form_table_user_fields` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '管理员id或用户id',
  `user_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '用户类型(0后台管理员, 1用户端)',
  `md5_key` char(32) NOT NULL DEFAULT '' COMMENT 'form表格数据唯一key',
  `fields` text COMMENT '字段数据(json格式存储)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `user_type` (`user_type`),
  KEY `md5_key` (`md5_key`)
D
sql  
Devil 已提交
321
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='动态表格用户自定义字段';
D
devil 已提交
322

D
v1.2.0  
devil_gong 已提交
323
-- ----------------------------
D
Devil 已提交
324
-- Table structure for s_goods
D
v1.2.0  
devil_gong 已提交
325 326 327 328 329
-- ----------------------------
DROP TABLE IF EXISTS `s_goods`;
CREATE TABLE `s_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `brand_id` int(11) unsigned DEFAULT '0' COMMENT '品牌id',
D
sql  
devil 已提交
330
  `site_type` tinyint(1) NOT NULL DEFAULT '-1' COMMENT '商品类型(跟随站点类型一致[0销售, 1展示, 2自提, 3虚拟销售, 4销售+自提])',
D
sql  
devil 已提交
331
  `title` char(160) NOT NULL DEFAULT '' COMMENT '标题',
D
devil_gong 已提交
332
  `title_color` char(7) NOT NULL DEFAULT '' COMMENT '标题颜色',
D
sql  
devil 已提交
333
  `simple_desc` char(230) NOT NULL DEFAULT '' COMMENT '简述',
D
devil_gong 已提交
334
  `model` char(30) NOT NULL DEFAULT '' COMMENT '型号',
D
v1.2.0  
devil_gong 已提交
335 336
  `place_origin` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '产地(地区省id)',
  `inventory` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '库存(所有规格库存总和)',
D
devil_gong 已提交
337
  `inventory_unit` char(15) NOT NULL DEFAULT '' COMMENT '库存单位',
D
v1.2.0  
devil_gong 已提交
338 339 340 341 342 343 344
  `images` char(255) NOT NULL DEFAULT '' COMMENT '封面图片',
  `original_price` char(60) NOT NULL DEFAULT '' COMMENT '原价(单值:10, 区间:10.00-20.00)一般用于展示使用',
  `min_original_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低原价',
  `max_original_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最大原价',
  `price` char(60) NOT NULL DEFAULT '' COMMENT '销售价格(单值:10, 区间:10.00-20.00)一般用于展示使用',
  `min_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低价格',
  `max_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最高价格',
D
devil 已提交
345
  `give_integral` int(6) unsigned NOT NULL DEFAULT '0' COMMENT '购买赠送积分比例',
D
v1.2.0  
devil_gong 已提交
346 347 348 349 350
  `buy_min_number` int(11) unsigned NOT NULL DEFAULT '1' COMMENT '最低起购数量 (默认1)',
  `buy_max_number` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最大购买数量(最大数值 100000000, 小于等于0或空则不限)',
  `is_deduction_inventory` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '是否扣减库存(0否, 1是)',
  `is_shelves` tinyint(2) unsigned NOT NULL DEFAULT '1' COMMENT '是否上架(下架后用户不可见, 0否, 1是)',
  `is_home_recommended` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '是否首页推荐(0否, 1是)',
D
sql  
devil_gong 已提交
351
  `content_web` mediumtext COMMENT '电脑端详情内容',
D
v1.2.0  
devil_gong 已提交
352 353 354 355
  `photo_count` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '相册图片数量',
  `sales_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
  `access_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '访问次数',
  `video` char(255) NOT NULL DEFAULT '' COMMENT '短视频',
D
devil_gong 已提交
356
  `is_exist_many_spec` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否存在多个规格(0否, 1是)',
D
sql  
devil_gong 已提交
357
  `spec_base` text COMMENT '规格基础数据',
D
devil_gong 已提交
358
  `fictitious_goods_value` text COMMENT '虚拟商品展示数据',
G
gongfuxiang 已提交
359
  `seo_title` char(100) NOT NULL DEFAULT '' COMMENT 'SEO标题',
D
devil_gong 已提交
360 361
  `seo_keywords` char(130) NOT NULL DEFAULT '' COMMENT 'SEO关键字',
  `seo_desc` char(230) NOT NULL DEFAULT '' COMMENT 'SEO描述',
D
v1.2.0  
devil_gong 已提交
362 363 364 365 366 367 368 369
  `is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否已删除(0 未删除, 大于0则是删除时间)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `title` (`title`),
  KEY `access_count` (`access_count`),
  KEY `photo_count` (`photo_count`),
  KEY `is_shelves` (`is_shelves`)
D
sql  
devil 已提交
370
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品';
D
v1.2.0  
devil_gong 已提交
371 372

-- ----------------------------
D
Devil 已提交
373
-- Table structure for s_goods_browse
D
v1.2.0  
devil_gong 已提交
374 375 376 377 378 379 380 381 382
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_browse`;
CREATE TABLE `s_goods_browse` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`)
D
Devil 已提交
383
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户商品浏览';
D
v1.2.0  
devil_gong 已提交
384 385

-- ----------------------------
D
Devil 已提交
386
-- Table structure for s_goods_category
D
v1.2.0  
devil_gong 已提交
387 388 389 390 391 392 393 394 395 396 397 398 399 400
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_category`;
CREATE TABLE `s_goods_category` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
  `icon` char(255) NOT NULL DEFAULT '' COMMENT 'icon图标',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
  `vice_name` char(80) NOT NULL DEFAULT '' COMMENT '副标题',
  `describe` char(255) NOT NULL DEFAULT '' COMMENT '描述',
  `bg_color` char(30) NOT NULL DEFAULT '' COMMENT 'css背景色值',
  `big_images` char(255) NOT NULL DEFAULT '' COMMENT '大图片',
  `is_home_recommended` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '是否首页推荐(0否, 1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
G
gongfuxiang 已提交
401 402 403
  `seo_title` char(100) NOT NULL DEFAULT '' COMMENT 'SEO标题',
  `seo_keywords` char(130) NOT NULL DEFAULT '' COMMENT 'SEO关键字',
  `seo_desc` char(230) NOT NULL DEFAULT '' COMMENT 'SEO描述',
D
v1.2.0  
devil_gong 已提交
404 405 406 407 408 409
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `pid` (`pid`),
  KEY `is_enable` (`is_enable`),
  KEY `sort` (`sort`)
D
sql  
devil 已提交
410
) ENGINE=InnoDB AUTO_INCREMENT=893 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品分类';
D
v1.2.0  
devil_gong 已提交
411 412

-- ----------------------------
D
Devil 已提交
413
-- Table structure for s_goods_category_join
D
v1.2.0  
devil_gong 已提交
414 415 416 417 418 419 420 421 422 423
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_category_join`;
CREATE TABLE `s_goods_category_join` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `category_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分类id',
  `add_time` int(11) unsigned DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `goods_id` (`goods_id`),
  KEY `category_id` (`category_id`)
D
sql  
Devil 已提交
424
) ENGINE=InnoDB AUTO_INCREMENT=753 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品分类关联';
D
v1.2.0  
devil_gong 已提交
425 426

-- ----------------------------
D
Devil 已提交
427
-- Table structure for s_goods_comments
D
devil_gong 已提交
428 429 430 431 432 433 434
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_comments`;
CREATE TABLE `s_goods_comments` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '业务订单id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
G
gongfuxiang 已提交
435
  `business_type` char(30) NOT NULL DEFAULT '' COMMENT '业务类型名称(如订单 order)',
D
devil_gong 已提交
436
  `content` char(255) NOT NULL DEFAULT '' COMMENT '评价内容',
D
devil_gong 已提交
437
  `images` text COMMENT '图片数据(一维数组json)',
D
devil_gong 已提交
438 439
  `reply` char(255) NOT NULL DEFAULT '' COMMENT '回复内容',
  `rating` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '评价级别(默认0 1~5)',
G
gongfuxiang 已提交
440
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否显示(0否, 1是)',
D
devil_gong 已提交
441 442 443 444
  `is_anonymous` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否匿名(0否,1是)',
  `is_reply` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否回复(0否,1是)',
  `reply_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '回复时间',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
G
gongfuxiang 已提交
445
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
D
devil_gong 已提交
446 447 448 449
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`),
  KEY `goods_id` (`goods_id`)
D
v1.9.0  
devil 已提交
450
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品评论';
D
devil_gong 已提交
451

D
v1.2.0  
devil_gong 已提交
452
-- ----------------------------
D
Devil 已提交
453
-- Table structure for s_goods_content_app
D
v1.2.0  
devil_gong 已提交
454 455 456 457 458 459 460 461 462 463 464 465
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_content_app`;
CREATE TABLE `s_goods_content_app` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `images` char(255) NOT NULL DEFAULT '' COMMENT '图片',
  `content` text COMMENT '内容',
  `sort` tinyint(3) unsigned DEFAULT '0' COMMENT '顺序',
  `add_time` int(11) unsigned DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `goods_id` (`goods_id`),
  KEY `sort` (`sort`)
D
sql  
Devil 已提交
466
) ENGINE=InnoDB AUTO_INCREMENT=1057 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品手机详情';
D
v1.2.0  
devil_gong 已提交
467 468

-- ----------------------------
D
Devil 已提交
469
-- Table structure for s_goods_favor
D
v1.2.0  
devil_gong 已提交
470 471 472 473 474 475 476 477
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_favor`;
CREATE TABLE `s_goods_favor` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`)
D
sql  
Devil 已提交
478
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户商品收藏';
D
sql  
devil 已提交
479 480

-- ----------------------------
D
Devil 已提交
481
-- Table structure for s_goods_params
D
sql  
devil 已提交
482 483 484 485 486 487 488 489 490 491 492 493
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_params`;
CREATE TABLE `s_goods_params` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `type` tinyint(1) unsigned DEFAULT '1' COMMENT '展示范围(0全部, 1详情, 2基础)默认1详情',
  `name` char(180) NOT NULL DEFAULT '' COMMENT '参数名称',
  `value` char(230) NOT NULL DEFAULT '' COMMENT '参数值',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `goods_id` (`goods_id`),
  KEY `type` (`type`)
D
sql  
Devil 已提交
494
) ENGINE=InnoDB AUTO_INCREMENT=573 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品参数';
D
sql  
devil 已提交
495 496

-- ----------------------------
D
Devil 已提交
497
-- Table structure for s_goods_params_template
D
Devil 已提交
498 499 500 501 502 503 504 505 506 507 508 509
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_params_template`;
CREATE TABLE `s_goods_params_template` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `config_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '参数配置数量',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `config_count` (`config_count`)
510
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品参数模板';
D
Devil 已提交
511 512

-- ----------------------------
D
Devil 已提交
513
-- Table structure for s_goods_params_template_config
D
Devil 已提交
514 515 516 517 518 519 520 521 522 523 524 525
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_params_template_config`;
CREATE TABLE `s_goods_params_template_config` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `template_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '模板id',
  `type` tinyint(1) unsigned DEFAULT '1' COMMENT '展示范围(0全部, 1详情, 2基础)默认1详情',
  `name` char(180) NOT NULL DEFAULT '' COMMENT '参数名称',
  `value` char(230) NOT NULL DEFAULT '' COMMENT '参数值',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `template_id` (`template_id`),
  KEY `type` (`type`)
526
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品参数模板值';
D
Devil 已提交
527 528

-- ----------------------------
D
Devil 已提交
529
-- Table structure for s_goods_photo
D
v1.2.0  
devil_gong 已提交
530 531 532 533 534 535 536 537 538 539 540 541 542
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_photo`;
CREATE TABLE `s_goods_photo` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `images` char(255) NOT NULL DEFAULT '' COMMENT '图片',
  `is_show` tinyint(3) unsigned DEFAULT '1' COMMENT '是否显示(0否, 1是)',
  `sort` tinyint(3) unsigned DEFAULT '0' COMMENT '顺序',
  `add_time` int(11) unsigned DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `goods_id` (`goods_id`),
  KEY `is_show` (`is_show`),
  KEY `sort` (`sort`)
D
sql  
Devil 已提交
543
) ENGINE=InnoDB AUTO_INCREMENT=823 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品相册图片';
D
v1.2.0  
devil_gong 已提交
544 545

-- ----------------------------
D
Devil 已提交
546
-- Table structure for s_goods_spec_base
D
v1.2.0  
devil_gong 已提交
547 548 549 550 551 552 553
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_spec_base`;
CREATE TABLE `s_goods_spec_base` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '销售价格',
  `inventory` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '库存',
554
  `weight` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '重量(kg) ',
D
v1.2.0  
devil_gong 已提交
555 556 557
  `coding` char(80) NOT NULL DEFAULT '' COMMENT '编码',
  `barcode` char(80) NOT NULL DEFAULT '' COMMENT '条形码',
  `original_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '原价',
G
gongfuxiang 已提交
558
  `extends` longtext COMMENT '扩展数据(json格式存储)',
D
v1.2.0  
devil_gong 已提交
559 560
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
D
sql  
devil 已提交
561
  KEY `goods_id` (`goods_id`)
D
sql  
Devil 已提交
562
) ENGINE=InnoDB AUTO_INCREMENT=1369 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品规格基础';
D
v1.2.0  
devil_gong 已提交
563 564

-- ----------------------------
D
Devil 已提交
565
-- Table structure for s_goods_spec_type
D
v1.2.0  
devil_gong 已提交
566 567 568 569 570 571
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_spec_type`;
CREATE TABLE `s_goods_spec_type` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `value` text NOT NULL COMMENT '类型值(json字符串存储)',
D
sql  
devil 已提交
572
  `name` char(230) NOT NULL DEFAULT '' COMMENT '类型名称',
D
v1.2.0  
devil_gong 已提交
573 574
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
D
devil_gong 已提交
575
  KEY `goods_id` (`goods_id`)
D
sql  
Devil 已提交
576
) ENGINE=InnoDB AUTO_INCREMENT=444 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品规格类型';
D
v1.2.0  
devil_gong 已提交
577 578

-- ----------------------------
D
Devil 已提交
579
-- Table structure for s_goods_spec_value
D
v1.2.0  
devil_gong 已提交
580 581 582 583 584 585
-- ----------------------------
DROP TABLE IF EXISTS `s_goods_spec_value`;
CREATE TABLE `s_goods_spec_value` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `goods_spec_base_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品规格基础id',
D
sql  
devil 已提交
586
  `value` char(230) NOT NULL DEFAULT '' COMMENT '规格值',
D
v1.2.0  
devil_gong 已提交
587 588
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
D
devil_gong 已提交
589
  KEY `goods_id` (`goods_id`),
D
v1.2.0  
devil_gong 已提交
590
  KEY `goods_spec_base_id` (`goods_spec_base_id`)
D
sql  
Devil 已提交
591
) ENGINE=InnoDB AUTO_INCREMENT=2675 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='商品规格值';
D
v1.2.0  
devil_gong 已提交
592 593

-- ----------------------------
D
Devil 已提交
594
-- Table structure for s_link
D
v1.2.0  
devil_gong 已提交
595 596 597 598 599 600
-- ----------------------------
DROP TABLE IF EXISTS `s_link`;
CREATE TABLE `s_link` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` char(30) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '导航名称',
  `url` char(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'url地址',
G
sql  
gongfuxiang 已提交
601
  `describe` char(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '描述',
D
v1.2.0  
devil_gong 已提交
602 603 604 605 606 607 608 609
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `is_new_window_open` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否新窗口打开(0否,1是)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `sort` (`sort`),
  KEY `is_enable` (`is_enable`)
D
devil 已提交
610
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='友情链接';
D
v1.2.0  
devil_gong 已提交
611 612

-- ----------------------------
D
Devil 已提交
613
-- Table structure for s_message
D
v1.2.0  
devil_gong 已提交
614 615 616 617 618 619 620 621
-- ----------------------------
DROP TABLE IF EXISTS `s_message`;
CREATE TABLE `s_message` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `title` char(60) NOT NULL DEFAULT '' COMMENT '标题',
  `detail` char(255) NOT NULL DEFAULT '' COMMENT '详情',
  `business_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '业务id',
D
devil 已提交
622
  `business_type` char(180) NOT NULL DEFAULT '' COMMENT '业务类型,字符串(如:订单、充值、提现、等...)',
D
v1.2.0  
devil_gong 已提交
623 624 625 626 627 628 629
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '消息类型(0普通通知, ...)',
  `is_read` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否已读(0否, 1是)',
  `is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否已删除(0否, 大于0删除时间)',
  `user_is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户是否已删除(0否, 大于0删除时间)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
D
Devil 已提交
630
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='消息';
D
v1.2.0  
devil_gong 已提交
631 632

-- ----------------------------
D
Devil 已提交
633
-- Table structure for s_navigation
D
v1.2.0  
devil_gong 已提交
634 635 636 637 638
-- ----------------------------
DROP TABLE IF EXISTS `s_navigation`;
CREATE TABLE `s_navigation` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
D
devil 已提交
639 640 641 642 643
  `name` char(30) NOT NULL DEFAULT '' COMMENT '导航名称',
  `url` char(255) NOT NULL DEFAULT '' COMMENT '自定义url地址',
  `value` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '数据 id',
  `data_type` char(30) NOT NULL DEFAULT '' COMMENT '数据类型(custom:自定义导航, article_class:文章分类, customview:自定义页面)',
  `nav_type` char(30) NOT NULL DEFAULT '' COMMENT '导航类型(header:顶部导航, footer:底部导航)',
D
v1.2.0  
devil_gong 已提交
644 645 646 647 648 649 650 651 652 653
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示(0否,1是)',
  `is_new_window_open` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否新窗口打开(0否,1是)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `is_show` (`is_show`),
  KEY `sort` (`sort`),
  KEY `nav_type` (`nav_type`),
  KEY `pid` (`pid`)
D
sql  
devil 已提交
654
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='导航';
D
v1.2.0  
devil_gong 已提交
655 656

-- ----------------------------
D
Devil 已提交
657
-- Table structure for s_order
D
v1.2.0  
devil_gong 已提交
658 659 660 661 662 663
-- ----------------------------
DROP TABLE IF EXISTS `s_order`;
CREATE TABLE `s_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_no` char(60) NOT NULL DEFAULT '' COMMENT '订单号',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
D
devil 已提交
664
  `warehouse_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '仓库id',
D
v1.2.0  
devil_gong 已提交
665 666 667
  `user_note` char(255) NOT NULL DEFAULT '' COMMENT '用户备注',
  `express_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '快递id',
  `express_number` char(60) NOT NULL DEFAULT '' COMMENT '快递单号',
D
devil_gong 已提交
668
  `payment_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式id',
D
v1.2.0  
devil_gong 已提交
669
  `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)',
G
gongfuxiang 已提交
670
  `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态(0未支付, 1已支付, 2已退款, 3部分退款)',
D
sql  
devil_gong 已提交
671
  `extension_data` longtext COMMENT '扩展展示数据',
G
gongfuxiang 已提交
672
  `buy_number_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '购买商品总数量',
D
devil_gong 已提交
673
  `increase_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '增加的金额',
D
v1.2.0  
devil_gong 已提交
674 675 676 677
  `preferential_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠金额',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单单价',
  `total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单总价(订单最终价格)',
  `pay_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '已支付金额',
D
devil_gong 已提交
678
  `refund_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '退款金额',
D
devil_gong 已提交
679 680
  `returned_quantity` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '退货数量',
  `client_type` char(30) NOT NULL DEFAULT '' COMMENT '客户端类型(pc, h5, ios, android, alipay, weixin, baidu)取APPLICATION_CLIENT_TYPE常量值',
D
devil_gong 已提交
681
  `order_model` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单模式(0销售型, 1展示型, 2自提点, 3虚拟销售)',
D
1.8.1  
devil 已提交
682
  `is_under_line` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否线下支付(0否,1是)',
D
v1.2.0  
devil_gong 已提交
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699
  `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',
  `confirm_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '确认时间',
  `delivery_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发货时间',
  `cancel_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '取消时间',
  `collect_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '收货时间',
  `close_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关闭时间',
  `comments_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '评论时间',
  `is_comments` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商家是否已评论(0否, 大于0评论时间)',
  `user_is_comments` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户是否已评论(0否, 大于0评论时间)',
  `is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商家是否已删除(0否, 大于0删除时间)',
  `user_is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户是否已删除(0否, 大于0删除时间)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_no` (`order_no`),
  KEY `user_id` (`user_id`),
  KEY `status` (`status`),
D
devil 已提交
700 701
  KEY `pay_status` (`pay_status`),
  KEY `warehouse_id` (`warehouse_id`)
D
Devil 已提交
702
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单';
D
sql  
devil_gong 已提交
703 704

-- ----------------------------
D
Devil 已提交
705
-- Table structure for s_order_address
D
sql  
devil_gong 已提交
706 707 708 709 710 711 712
-- ----------------------------
DROP TABLE IF EXISTS `s_order_address`;
CREATE TABLE `s_order_address` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `address_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '收件地址id',
D
devil_gong 已提交
713
  `alias` char(60) NOT NULL DEFAULT '' COMMENT '别名',
D
sql  
devil_gong 已提交
714 715 716 717 718 719 720 721 722
  `name` char(60) NOT NULL DEFAULT '' COMMENT '收件人-姓名',
  `tel` char(15) NOT NULL DEFAULT '' COMMENT '收件人-电话',
  `province` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '收件人-省',
  `city` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '收件人-市',
  `county` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '收件人-县/区',
  `address` char(200) NOT NULL DEFAULT '' COMMENT '收件人-详细地址',
  `province_name` char(30) NOT NULL DEFAULT '' COMMENT '收件人-省-名称',
  `city_name` char(30) NOT NULL DEFAULT '' COMMENT '收件人-市-名称',
  `county_name` char(30) NOT NULL DEFAULT '' COMMENT '收件人-县/区-名称',
D
sql  
devil 已提交
723 724
  `lng` decimal(13,10) NOT NULL DEFAULT '0.0000000000' COMMENT '收货地址-经度',
  `lat` decimal(13,10) NOT NULL DEFAULT '0.0000000000' COMMENT '收货地址-纬度',
D
devil 已提交
725 726 727 728
  `idcard_name` char(60) NOT NULL DEFAULT '' COMMENT '身份证姓名',
  `idcard_number` char(30) NOT NULL DEFAULT '' COMMENT '身份证号码',
  `idcard_front` char(255) NOT NULL DEFAULT '' COMMENT '身份证人像面图片',
  `idcard_back` char(255) NOT NULL DEFAULT '' COMMENT '身份证国微面图片',
D
sql  
devil_gong 已提交
729 730 731 732 733
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  KEY `user_id` (`user_id`)
D
Devil 已提交
734
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单地址';
D
v1.2.0  
devil_gong 已提交
735

D
devil_gong 已提交
736
-- ----------------------------
D
Devil 已提交
737
-- Table structure for s_order_aftersale
D
devil_gong 已提交
738 739 740 741
-- ----------------------------
DROP TABLE IF EXISTS `s_order_aftersale`;
CREATE TABLE `s_order_aftersale` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
D
devil_gong 已提交
742
  `order_no` char(60) NOT NULL DEFAULT '' COMMENT '订单号',
D
devil_gong 已提交
743
  `order_detail_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单详情id',
D
devil_gong 已提交
744
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
D
devil_gong 已提交
745
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
D
devil_gong 已提交
746
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
D
devil_gong 已提交
747 748 749
  `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0待确认, 1待退货, 2待审核, 3已完成, 4已拒绝, 5已取消)',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '业务类型(0仅退款, 1退货退款)',
  `refundment` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '退款类型(0原路退回, 1退至钱包, 2手动处理)',
D
devil_gong 已提交
750 751 752 753 754 755
  `reason` char(180) NOT NULL DEFAULT '' COMMENT '申请原因',
  `number` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '退货数量',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',
  `msg` char(230) NOT NULL DEFAULT '' COMMENT '退款说明',
  `images` text COMMENT '凭证图片(一维数组json存储)',
  `refuse_reason` char(230) NOT NULL DEFAULT '' COMMENT '拒绝原因',
D
devil_gong 已提交
756
  `express_name` char(60) NOT NULL DEFAULT '' COMMENT '快递名称',
D
devil_gong 已提交
757
  `express_number` char(60) NOT NULL DEFAULT '' COMMENT '快递单号',
D
devil_gong 已提交
758 759
  `apply_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '申请时间',
  `confirm_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '确认时间',
D
devil_gong 已提交
760 761 762
  `delivery_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '退货时间',
  `audit_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '审核时间',
  `cancel_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '取消时间',
D
devil_gong 已提交
763 764 765 766
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
D
devil_gong 已提交
767
  KEY `goods_id` (`goods_id`),
D
devil_gong 已提交
768 769
  KEY `user_id` (`user_id`),
  KEY `status` (`status`)
D
sql  
Devil 已提交
770
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单售后';
D
devil 已提交
771 772

-- ----------------------------
D
Devil 已提交
773
-- Table structure for s_order_currency
D
devil 已提交
774 775 776 777 778 779 780 781 782
-- ----------------------------
DROP TABLE IF EXISTS `s_order_currency`;
CREATE TABLE `s_order_currency` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `currency_name` char(80) NOT NULL DEFAULT '' COMMENT '货币名称',
  `currency_code` char(60) NOT NULL DEFAULT '' COMMENT '货币代码',
  `currency_symbol` char(60) NOT NULL DEFAULT '' COMMENT '货币符号',
D
devil 已提交
783
  `currency_rate` decimal(7,6) unsigned NOT NULL DEFAULT '0.000000' COMMENT '货币汇率',
D
devil 已提交
784 785 786 787 788 789 790
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  KEY `user_id` (`user_id`),
  KEY `currency_name` (`currency_name`),
  KEY `currency_code` (`currency_code`),
  KEY `currency_rate` (`currency_rate`)
D
Devil 已提交
791
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单货币';
G
gongfuxiang 已提交
792

D
v1.2.0  
devil_gong 已提交
793
-- ----------------------------
D
Devil 已提交
794
-- Table structure for s_order_detail
D
v1.2.0  
devil_gong 已提交
795 796 797 798 799 800 801 802 803 804
-- ----------------------------
DROP TABLE IF EXISTS `s_order_detail`;
CREATE TABLE `s_order_detail` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `title` char(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '标题',
  `images` char(255) NOT NULL DEFAULT '' COMMENT '封面图片',
  `original_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '原价',
D
devil 已提交
805
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '价格',
D
devil_gong 已提交
806
  `total_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '当前总价(单价*数量)',
D
sql  
devil_gong 已提交
807
  `spec` text COMMENT '规格',
D
v1.2.0  
devil_gong 已提交
808
  `buy_number` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '购买数量',
D
devil_gong 已提交
809
  `model` char(30) NOT NULL DEFAULT '' COMMENT '型号',
D
devil_gong 已提交
810
  `spec_weight` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '重量(kg)',
811
  `spec_coding` char(80) NOT NULL DEFAULT '' COMMENT '编码',
D
sql  
devil_gong 已提交
812
  `spec_barcode` char(80) NOT NULL DEFAULT '' COMMENT '条形码',
D
devil_gong 已提交
813 814
  `refund_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '退款金额',
  `returned_quantity` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '退货数量',
D
v1.2.0  
devil_gong 已提交
815 816 817 818 819
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`),
D
devil_gong 已提交
820
  KEY `goods_id` (`goods_id`)
D
Devil 已提交
821
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单详情';
D
devil_gong 已提交
822 823

-- ----------------------------
D
Devil 已提交
824
-- Table structure for s_order_extraction_code
D
devil_gong 已提交
825 826 827 828 829 830 831 832 833 834 835 836
-- ----------------------------
DROP TABLE IF EXISTS `s_order_extraction_code`;
CREATE TABLE `s_order_extraction_code` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `code` char(30) NOT NULL DEFAULT '' COMMENT '取货码',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  KEY `user_id` (`user_id`)
D
Devil 已提交
837
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单自提取货码关联';
D
devil_gong 已提交
838 839

-- ----------------------------
D
Devil 已提交
840
-- Table structure for s_order_fictitious_value
D
devil_gong 已提交
841 842 843 844 845 846 847 848 849 850 851 852 853 854
-- ----------------------------
DROP TABLE IF EXISTS `s_order_fictitious_value`;
CREATE TABLE `s_order_fictitious_value` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `order_detail_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单详情id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `value` text COMMENT '虚拟商品展示数据',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  KEY `order_detail_id` (`order_detail_id`),
  KEY `user_id` (`user_id`)
D
v1.9.0  
devil 已提交
855
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单虚拟销售数据关联';
D
v1.2.0  
devil_gong 已提交
856 857

-- ----------------------------
D
Devil 已提交
858
-- Table structure for s_order_goods_inventory_log
D
v1.2.0  
devil_gong 已提交
859 860 861 862 863
-- ----------------------------
DROP TABLE IF EXISTS `s_order_goods_inventory_log`;
CREATE TABLE `s_order_goods_inventory_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
D
Devil 已提交
864
  `order_detail_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单详情id',
D
v1.2.0  
devil_gong 已提交
865 866 867 868 869 870 871 872 873 874
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `order_status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)',
  `original_inventory` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '原库存',
  `new_inventory` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最新库存',
  `is_rollback` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否回滚(0否, 1是)',
  `rollback_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '回滚时间',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  KEY `goods_id` (`goods_id`),
D
Devil 已提交
875 876
  KEY `order_status` (`order_status`),
  KEY `order_detail_id` (`order_detail_id`)
D
sql  
Devil 已提交
877
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单商品库存变更日志';
D
v1.2.0  
devil_gong 已提交
878 879

-- ----------------------------
D
Devil 已提交
880
-- Table structure for s_order_status_history
D
v1.2.0  
devil_gong 已提交
881 882 883 884 885 886 887 888 889 890 891 892 893 894 895
-- ----------------------------
DROP TABLE IF EXISTS `s_order_status_history`;
CREATE TABLE `s_order_status_history` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `original_status` varchar(60) NOT NULL DEFAULT '' COMMENT '原始状态',
  `new_status` varchar(60) NOT NULL DEFAULT '' COMMENT '最新状态',
  `msg` varchar(255) NOT NULL DEFAULT '' COMMENT '操作描述',
  `creator` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建-用户id',
  `creator_name` varchar(60) NOT NULL DEFAULT '' COMMENT '创建人-姓名',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`),
  KEY `original_status` (`original_status`),
  KEY `new_status` (`new_status`)
D
sql  
Devil 已提交
896
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单状态历史纪录';
D
v1.2.0  
devil_gong 已提交
897 898

-- ----------------------------
D
Devil 已提交
899
-- Table structure for s_pay_log
D
v1.2.0  
devil_gong 已提交
900 901 902 903
-- ----------------------------
DROP TABLE IF EXISTS `s_pay_log`;
CREATE TABLE `s_pay_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '支付日志id',
D
devil 已提交
904
  `log_no` char(60) NOT NULL DEFAULT '' COMMENT '支付日志订单号',
D
v1.2.0  
devil_gong 已提交
905
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
D
devil 已提交
906 907
  `business_type` char(180) NOT NULL DEFAULT '' COMMENT '业务类型,字符串(如:订单、钱包充值、会员购买、等...)',
  `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0待支付, 1已支付, 2已关闭)正常30分钟内未支付将关闭',
D
v1.2.0  
devil_gong 已提交
908 909
  `payment` char(60) NOT NULL DEFAULT '' COMMENT '支付方式标记',
  `payment_name` char(60) NOT NULL DEFAULT '' COMMENT '支付方式名称',
D
devil 已提交
910 911 912 913 914
  `subject` char(255) NOT NULL DEFAULT '' COMMENT '订单名称',
  `total_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '业务订单金额',
  `pay_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `trade_no` char(100) NOT NULL DEFAULT '' COMMENT '支付平台交易号',
  `buyer_user` char(60) NOT NULL DEFAULT '' COMMENT '支付平台用户帐号',
D
devil 已提交
915 916 917
  `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',
  `close_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关闭时间',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
D
v1.2.0  
devil_gong 已提交
918
  PRIMARY KEY (`id`),
D
devil 已提交
919 920 921 922 923 924 925 926
  KEY `payment` (`payment`),
  KEY `status` (`status`),
  KEY `business_type` (`business_type`),
  KEY `total_price` (`total_price`),
  KEY `pay_price` (`pay_price`),
  KEY `add_time` (`add_time`),
  KEY `pay_time` (`pay_time`),
  KEY `close_time` (`close_time`)
D
Devil 已提交
927
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='支付日志';
D
devil 已提交
928 929

-- ----------------------------
D
Devil 已提交
930
-- Table structure for s_pay_log_value
D
devil 已提交
931 932 933 934 935 936 937 938 939 940 941 942
-- ----------------------------
DROP TABLE IF EXISTS `s_pay_log_value`;
CREATE TABLE `s_pay_log_value` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `pay_log_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付日志id',
  `business_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '业务订单id',
  `business_no` char(60) NOT NULL DEFAULT '' COMMENT '业务订单号',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `pay_log_id` (`pay_log_id`),
  KEY `business_id` (`business_id`),
  KEY `add_time` (`add_time`)
D
Devil 已提交
943
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='支付日志关联业务数据';
D
devil 已提交
944 945

-- ----------------------------
D
Devil 已提交
946
-- Table structure for s_pay_request_log
D
devil 已提交
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969
-- ----------------------------
DROP TABLE IF EXISTS `s_pay_request_log`;
CREATE TABLE `s_pay_request_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `business_type` char(180) NOT NULL DEFAULT '' COMMENT '业务类型,字符串(如:订单、钱包充值、会员购买、等...)',
  `request_params` mediumtext COMMENT '请求参数(数组则json字符串存储)',
  `response_data` mediumtext COMMENT '响应参数(数组则json字符串存储)',
  `business_handle` text COMMENT '业务处理结果(数组则json字符串存储)',
  `request_url` text COMMENT '请求url地址',
  `server_port` char(10) NOT NULL DEFAULT '' COMMENT '端口号',
  `server_ip` char(15) NOT NULL DEFAULT '' COMMENT '服务器ip',
  `client_ip` char(15) NOT NULL DEFAULT '' COMMENT '客户端ip',
  `os` char(20) NOT NULL DEFAULT '' COMMENT '操作系统',
  `browser` char(20) NOT NULL DEFAULT '' COMMENT '浏览器',
  `method` char(4) NOT NULL DEFAULT '' COMMENT '请求类型',
  `scheme` char(5) NOT NULL DEFAULT '' COMMENT 'http类型',
  `version` char(5) NOT NULL DEFAULT '' COMMENT 'http版本',
  `client` char(255) NOT NULL DEFAULT '' COMMENT '客户端详情信息',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `business_type` (`business_type`),
  KEY `add_time` (`add_time`)
D
v1.9.1  
devil 已提交
970
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='支付请求日志';
D
v1.2.0  
devil_gong 已提交
971 972

-- ----------------------------
D
Devil 已提交
973
-- Table structure for s_payment
D
v1.2.0  
devil_gong 已提交
974 975 976 977 978 979 980 981 982 983 984 985 986 987
-- ----------------------------
DROP TABLE IF EXISTS `s_payment`;
CREATE TABLE `s_payment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` char(30) NOT NULL COMMENT '名称',
  `payment` char(60) NOT NULL DEFAULT '' COMMENT '唯一标记',
  `logo` char(255) NOT NULL DEFAULT '' COMMENT 'logo',
  `version` char(255) NOT NULL DEFAULT '' COMMENT '插件版本',
  `apply_version` char(255) NOT NULL DEFAULT '' COMMENT '适用系统版本',
  `desc` char(255) NOT NULL DEFAULT '' COMMENT '插件描述',
  `author` char(255) NOT NULL DEFAULT '' COMMENT '作者',
  `author_url` char(255) NOT NULL DEFAULT '' COMMENT '作者主页',
  `element` text COMMENT '配置项规则',
  `config` text COMMENT '配置数据',
D
devil 已提交
988 989
  `apply_terminal` char(255) NOT NULL COMMENT '适用终端 php一维数组json字符串存储(pc, h5, ios, android, alipay, weixin, baidu, toutiao, qq)',
  `apply_terminal_old` char(255) NOT NULL COMMENT '原始适用终端 php一维数组json字符串存储(pc, h5, ios, android, alipay, weixin, baidu, toutiao, qq)',
D
v1.2.0  
devil_gong 已提交
990 991 992 993 994 995 996 997
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `is_open_user` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否对用户开放',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '顺序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `payment` (`payment`),
  KEY `is_enable` (`is_enable`)
D
Devil 已提交
998
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='支付方式';
D
v1.2.0  
devil_gong 已提交
999

G
1.3.0  
gongfuxiang 已提交
1000
-- ----------------------------
D
Devil 已提交
1001
-- Table structure for s_plugins
G
1.3.0  
gongfuxiang 已提交
1002 1003 1004 1005 1006
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins`;
CREATE TABLE `s_plugins` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `plugins` char(60) NOT NULL DEFAULT '' COMMENT '唯一标记',
G
sql  
gongfuxiang 已提交
1007
  `data` longtext COMMENT '应用数据',
G
1.3.0  
gongfuxiang 已提交
1008 1009 1010 1011 1012 1013
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `plugins` (`plugins`),
  KEY `is_enable` (`is_enable`)
D
Devil 已提交
1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='应用';

-- ----------------------------
-- Table structure for s_plugins_answers_goods
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_answers_goods`;
CREATE TABLE `s_plugins_answers_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='问答系统商品 - 应用';

-- ----------------------------
-- Table structure for s_plugins_answers_slide
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_answers_slide`;
CREATE TABLE `s_plugins_answers_slide` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '别名',
  `images_url` char(255) NOT NULL DEFAULT '' COMMENT '图片地址',
  `url` char(255) NOT NULL DEFAULT '' COMMENT 'url地址',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `is_enable` (`is_enable`),
  KEY `sort` (`sort`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='问答系统轮播图 - 应用';

-- ----------------------------
-- Table structure for s_plugins_distribution_integral_log
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_distribution_integral_log`;
CREATE TABLE `s_plugins_distribution_integral_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `integral` int(11) unsigned NOT NULL COMMENT '积分',
  `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0待发放, 1已发放, 2已退回)',
  `msg` char(255) NOT NULL DEFAULT '' COMMENT '描述(一般用于退回描述)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分销积分明细 - 应用';

-- ----------------------------
-- Table structure for s_plugins_distribution_level
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_distribution_level`;
CREATE TABLE `s_plugins_distribution_level` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` char(30) NOT NULL DEFAULT '' COMMENT '名称',
  `images_url` char(255) NOT NULL DEFAULT '' COMMENT '图标',
  `rules_min` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费最小金额',
  `rules_max` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费最大金额',
  `level_rate_one` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '一级返佣比例',
  `level_rate_two` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '二级返佣比例',
  `level_rate_three` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '三级返佣比例',
  `down_return_rate` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '向下返佣比例',
  `self_buy_rate` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '内购返佣比例',
  `force_current_user_rate_one` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '强制返佣至取货点返佣比例(一级)',
  `force_current_user_rate_two` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '强制返佣至取货点返佣比例(二级)',
  `force_current_user_rate_three` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '强制返佣至取货点返佣比例(三级)',
  `is_level_auto` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否自动分配等级(0否, 1是)',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否启用(0否, 1是)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `is_enable` (`is_enable`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分销等级 - 应用';

-- ----------------------------
-- Table structure for s_plugins_distribution_profit_log
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_distribution_profit_log`;
CREATE TABLE `s_plugins_distribution_profit_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `order_id` int(11) unsigned NOT NULL COMMENT '订单id',
  `order_user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单用户id',
  `total_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单金额',
  `profit_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '收益金额',
  `rate` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '等级返佣比例 0~100 的数字(创建时写入,防止发生退款重新计算时用户等级变更)',
  `spec_extends` mediumtext COMMENT '订单中所购买的商品对应规格的扩展数据(用于重新计算时候使用)',
  `level` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '当前级别(1~3)0则是向下返佣',
  `user_level_id` char(60) NOT NULL DEFAULT '' COMMENT '用户等级id',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '结算状态(0待生效, 1待结算, 2已结算, 3已失效)',
  `msg` char(255) NOT NULL DEFAULT '' COMMENT '描述(一般用于退款描述)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分销佣金明细 - 应用';

-- ----------------------------
-- Table structure for s_plugins_distribution_user_self_extraction
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_distribution_user_self_extraction`;
CREATE TABLE `s_plugins_distribution_user_self_extraction` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '站点id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '站点所属用户id',
  `alias` char(60) NOT NULL DEFAULT '' COMMENT '别名',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '姓名',
  `tel` char(15) NOT NULL DEFAULT '' COMMENT '电话',
  `province` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在省',
  `city` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在市',
  `county` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在县/区',
  `address` char(80) NOT NULL DEFAULT '' COMMENT '详细地址',
  `lng` decimal(13,10) unsigned NOT NULL DEFAULT '0.0000000000' COMMENT '经度',
  `lat` decimal(13,10) unsigned NOT NULL DEFAULT '0.0000000000' COMMENT '纬度',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0待审核, 1已通过, 2已拒绝, 3已解约)',
  `fail_reason` char(200) NOT NULL DEFAULT '' COMMENT '审核拒绝原因',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分销商取货点 - 应用';

-- ----------------------------
-- Table structure for s_plugins_distribution_user_self_extraction_order
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_distribution_user_self_extraction_order`;
CREATE TABLE `s_plugins_distribution_user_self_extraction_order` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '站点id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '站点所属用户id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `self_extraction_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '取货点地址id',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0待处理, 1已处理)',
  `notes` char(200) NOT NULL DEFAULT '' COMMENT '备注',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`),
  KEY `self_extraction_id` (`self_extraction_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分销商取货点关联订单 - 应用';

-- ----------------------------
-- Table structure for s_plugins_invoice
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_invoice`;
CREATE TABLE `s_plugins_invoice` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `business_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '业务类型(0订单、...更多)',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0待审核、1待开票、2已开票、3已拒绝)',
  `total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '发票金额',
  `apply_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '申请类型(0个人、1企业)',
  `invoice_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '发票类型(0增值税普通电子发票、1增值税普通纸质发票、2增值税专业纸质发票)',
  `invoice_content` char(230) NOT NULL DEFAULT '' COMMENT '发票内容',
  `invoice_title` char(200) NOT NULL DEFAULT '' COMMENT '个人姓名或企业名称',
  `invoice_code` char(160) NOT NULL DEFAULT '' COMMENT '企业统一社会信用代码或纳税识别号',
  `invoice_bank` char(200) NOT NULL DEFAULT '' COMMENT '企业开户行名称',
  `invoice_account` char(160) NOT NULL DEFAULT '' COMMENT '企业开户帐号',
  `invoice_tel` char(15) NOT NULL DEFAULT '' COMMENT '企业联系电话',
  `invoice_address` char(230) NOT NULL DEFAULT '' COMMENT '企业注册地址',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '收件人姓名',
  `tel` char(15) NOT NULL DEFAULT '' COMMENT '收件人电话',
  `email` char(60) NOT NULL DEFAULT '' COMMENT '电子邮箱(接收电子发票)',
  `address` char(230) NOT NULL DEFAULT '' COMMENT '收件人详细地址',
  `electronic_invoice` text COMMENT '附件地址(电子发票json存储[title,url])',
  `express_name` char(60) NOT NULL DEFAULT '' COMMENT '快递名称(纸质)',
  `express_number` char(60) NOT NULL DEFAULT '' COMMENT '快递单号(纸质)',
  `refuse_reason` char(230) NOT NULL DEFAULT '' COMMENT '拒绝原因',
  `user_note` char(255) NOT NULL DEFAULT '' COMMENT '用户备注',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `business_type` (`business_type`),
  KEY `apply_type` (`apply_type`),
  KEY `invoice_type` (`invoice_type`),
  KEY `invoice_title` (`invoice_title`),
  KEY `invoice_bank` (`invoice_bank`),
  KEY `status` (`status`),
  KEY `name` (`name`),
  KEY `tel` (`tel`),
  KEY `email` (`email`),
  KEY `express_number` (`express_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='发票数据 - 应用';

-- ----------------------------
-- Table structure for s_plugins_invoice_value
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_invoice_value`;
CREATE TABLE `s_plugins_invoice_value` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `invoice_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付日志id',
  `business_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '业务订单id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `invoice_id` (`invoice_id`),
  KEY `business_id` (`business_id`),
  KEY `add_time` (`add_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='发票数据业务id - 应用';

-- ----------------------------
-- Table structure for s_plugins_ordergoodsform
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_ordergoodsform`;
CREATE TABLE `s_plugins_ordergoodsform` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `title` char(60) NOT NULL DEFAULT '' COMMENT '标题',
  `config_data` longtext COMMENT '配置表单数据',
  `config_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '配置表单数量',
  `goods_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联商品数量',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `title` (`title`),
  KEY `is_enable` (`is_enable`),
  KEY `config_count` (`config_count`),
  KEY `goods_count` (`goods_count`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='下单商品表单 - 应用';

-- ----------------------------
-- Table structure for s_plugins_ordergoodsform_goods
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_ordergoodsform_goods`;
CREATE TABLE `s_plugins_ordergoodsform_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `form_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品表单id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `form_id` (`form_id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='下单商品表单关联商品 - 应用';

-- ----------------------------
-- Table structure for s_plugins_ordergoodsform_goods_data
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_ordergoodsform_goods_data`;
CREATE TABLE `s_plugins_ordergoodsform_goods_data` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `form_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品表单id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `title` char(60) NOT NULL DEFAULT '' COMMENT '标题',
  `md5_key` char(32) NOT NULL DEFAULT '' COMMENT '数据唯一md5key',
  `content` text COMMENT '数据值',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `form_id` (`form_id`),
  KEY `goods_id` (`goods_id`),
  KEY `md5_key` (`md5_key`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='下单商品表单关联商品数据 - 应用';

-- ----------------------------
-- Table structure for s_plugins_ordergoodsform_order_data
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_ordergoodsform_order_data`;
CREATE TABLE `s_plugins_ordergoodsform_order_data` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `form_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品表单id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `order_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `md5_key` char(32) NOT NULL DEFAULT '' COMMENT '数据唯一md5key',
  `title` char(60) NOT NULL DEFAULT '' COMMENT '标题',
  `content` text COMMENT '数据值',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `form_id` (`form_id`),
  KEY `goods_id` (`goods_id`),
  KEY `order_id` (`order_id`),
  KEY `user_id` (`user_id`),
  KEY `md5_key` (`md5_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='下单商品表单关联订单数据 - 应用';

-- ----------------------------
-- Table structure for s_plugins_signin_qrcode
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_signin_qrcode`;
CREATE TABLE `s_plugins_signin_qrcode` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `request_id` int(11) NOT NULL DEFAULT '0' COMMENT '来源签到码id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `reward_master` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '邀请人奖励积分',
  `reward_invitee` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '受邀人奖励积分',
  `continuous_rules` text COMMENT '连续签到翻倍奖励配置数据',
  `specified_time_reward` char(255) NOT NULL DEFAULT '' COMMENT '指定时段额外奖励',
  `max_number_limit` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最大奖励数量限制(0则不限制)',
  `day_number_limit` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '一天奖励数量限制(0则不限制)',
  `right_images` char(255) NOT NULL DEFAULT '' COMMENT '右侧图片',
  `right_images_url_rules` text COMMENT '右侧图片链接地址规则(客户端类型=>链接地址)',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '联系人姓名',
  `tel` char(15) NOT NULL DEFAULT '' COMMENT '联系人电话',
  `address` char(230) NOT NULL DEFAULT '' COMMENT '联系地址',
  `goods_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联商品数量',
  `access_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '访问次数',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否启用(0否,1是)',
  `note` char(255) NOT NULL DEFAULT '' COMMENT '备注',
  `footer_code` text COMMENT '底部代码',
  `seo_title` char(100) NOT NULL DEFAULT '' COMMENT 'SEO标题',
  `seo_keywords` char(130) NOT NULL DEFAULT '' COMMENT 'SEO关键字',
  `seo_desc` char(230) NOT NULL DEFAULT '' COMMENT 'SEO描述',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `reward_master` (`reward_master`),
  KEY `reward_invitee` (`reward_invitee`),
  KEY `goods_count` (`goods_count`),
  KEY `access_count` (`access_count`),
  KEY `name` (`name`),
  KEY `tel` (`tel`),
  KEY `is_enable` (`is_enable`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='签到码 - 应用';
D
devil 已提交
1335

D
v1.2.0  
devil_gong 已提交
1336
-- ----------------------------
D
Devil 已提交
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481
-- Table structure for s_plugins_signin_qrcode_data
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_signin_qrcode_data`;
CREATE TABLE `s_plugins_signin_qrcode_data` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `qrcode_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '签到码id',
  `integral` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '奖励积分',
  `ymd` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '年月日',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `qrcode_id` (`qrcode_id`),
  KEY `integral` (`integral`),
  KEY `ymd` (`ymd`),
  KEY `add_time` (`add_time`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='签到码数据 - 应用';

-- ----------------------------
-- Table structure for s_plugins_signin_qrcode_goods
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_signin_qrcode_goods`;
CREATE TABLE `s_plugins_signin_qrcode_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `qrcode_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '活动id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `qrcode_id` (`qrcode_id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=138 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='签到码关联商品 - 应用';

-- ----------------------------
-- Table structure for s_plugins_speedplaceorder_cart
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_speedplaceorder_cart`;
CREATE TABLE `s_plugins_speedplaceorder_cart` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned DEFAULT '0' COMMENT '用户id',
  `goods_id` int(11) unsigned DEFAULT '0' COMMENT '商品id',
  `title` char(60) NOT NULL DEFAULT '' COMMENT '标题',
  `images` char(255) NOT NULL DEFAULT '' COMMENT '封面图片',
  `original_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '原价',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '销售价格',
  `stock` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '购买数量',
  `spec` text COMMENT '规格',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `goods_id` (`goods_id`),
  KEY `title` (`title`),
  KEY `stock` (`stock`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='快速下单购物车 - 应用';

-- ----------------------------
-- Table structure for s_plugins_wallet
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_wallet`;
CREATE TABLE `s_plugins_wallet` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0正常, 1异常, 2已注销)',
  `normal_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '有效金额(包含赠送金额)',
  `frozen_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '冻结金额',
  `give_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '赠送金额(所有赠送金额总计)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`) USING BTREE,
  KEY `status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='钱包 - 应用';

-- ----------------------------
-- Table structure for s_plugins_wallet_cash
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_wallet_cash`;
CREATE TABLE `s_plugins_wallet_cash` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `wallet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '钱包id',
  `cash_no` char(60) NOT NULL DEFAULT '' COMMENT '提现单号',
  `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0未打款, 1已打款, 2打款失败)',
  `money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '提现金额',
  `pay_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '打款金额',
  `bank_name` char(60) NOT NULL DEFAULT '' COMMENT '收款平台',
  `bank_accounts` char(60) NOT NULL DEFAULT '' COMMENT '收款账号',
  `bank_username` char(60) NOT NULL DEFAULT '' COMMENT '开户人姓名',
  `msg` char(200) NOT NULL DEFAULT '' COMMENT '描述(用户可见)',
  `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '打款时间',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `cash_no` (`cash_no`),
  KEY `status` (`status`),
  KEY `user_id` (`user_id`),
  KEY `wallet_id` (`wallet_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='钱包提现 - 应用';

-- ----------------------------
-- Table structure for s_plugins_wallet_log
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_wallet_log`;
CREATE TABLE `s_plugins_wallet_log` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `wallet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '钱包id',
  `business_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '业务类型(0系统, 1充值, 2提现, 3消费)',
  `money_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '金额类型(0正常, 1冻结, 2赠送)',
  `operation_type` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '操作类型( 0减少, 1增加)',
  `operation_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '操作金额',
  `original_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '原始金额',
  `latest_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最新金额',
  `msg` char(200) NOT NULL DEFAULT '' COMMENT '变更说明',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `wallet_id` (`wallet_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='钱包日志 - 应用';

-- ----------------------------
-- Table structure for s_plugins_wallet_recharge
-- ----------------------------
DROP TABLE IF EXISTS `s_plugins_wallet_recharge`;
CREATE TABLE `s_plugins_wallet_recharge` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `wallet_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '钱包id',
  `recharge_no` char(60) NOT NULL DEFAULT '' COMMENT '充值单号',
  `status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0未支付, 1已支付)',
  `money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '金额',
  `pay_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `payment_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式id',
  `payment` char(60) NOT NULL DEFAULT '' COMMENT '支付方式标记',
  `payment_name` char(60) NOT NULL DEFAULT '' COMMENT '支付方式名称',
  `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `recharge_no` (`recharge_no`),
  KEY `status` (`status`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='钱包充值 - 应用';

-- ----------------------------
-- Table structure for s_power
D
v1.2.0  
devil_gong 已提交
1482 1483 1484 1485 1486 1487 1488 1489
-- ----------------------------
DROP TABLE IF EXISTS `s_power`;
CREATE TABLE `s_power` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '权限id',
  `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '权限父级id',
  `name` char(30) NOT NULL DEFAULT '' COMMENT '权限名称',
  `control` char(30) NOT NULL DEFAULT '' COMMENT '控制器名称',
  `action` char(30) NOT NULL DEFAULT '' COMMENT '方法名称',
D
devil 已提交
1490
  `url` char(255) NOT NULL DEFAULT '' COMMENT '自定义url地址',
D
v1.2.0  
devil_gong 已提交
1491 1492 1493 1494 1495
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示(0否,1是)',
  `icon` char(60) NOT NULL DEFAULT '' COMMENT '图标class',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`)
D
Devil 已提交
1496
) ENGINE=InnoDB AUTO_INCREMENT=468 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='权限';
D
v1.2.0  
devil_gong 已提交
1497 1498

-- ----------------------------
D
Devil 已提交
1499
-- Table structure for s_quick_nav
D
sql  
devil 已提交
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517
-- ----------------------------
DROP TABLE IF EXISTS `s_quick_nav`;
CREATE TABLE `s_quick_nav` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `platform` char(30) NOT NULL DEFAULT 'pc' COMMENT '所属平台(pc PC网站, h5 H5手机网站, ios 苹果APP, android 安卓APP, alipay 支付宝小程序, weixin 微信小程序, baidu 百度小程序, toutiao 头条小程序, qq QQ小程序)',
  `event_type` tinyint(2) NOT NULL DEFAULT '-1' COMMENT '事件类型(0 WEB页面, 1 内部页面(小程序或APP内部地址), 2 外部小程序(同一个主体下的小程序appid), 3 打开地图, 4 拨打电话)',
  `event_value` char(255) NOT NULL DEFAULT '' COMMENT '事件值',
  `images_url` char(255) NOT NULL DEFAULT '' COMMENT '图片地址',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `bg_color` char(30) NOT NULL DEFAULT '' COMMENT 'css背景色值',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `platform` (`platform`),
  KEY `is_enable` (`is_enable`),
  KEY `sort` (`sort`)
D
devil 已提交
1518
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='快捷导航';
D
sql  
devil 已提交
1519 1520

-- ----------------------------
D
Devil 已提交
1521
-- Table structure for s_refund_log
D
devil_gong 已提交
1522 1523 1524 1525 1526
-- ----------------------------
DROP TABLE IF EXISTS `s_refund_log`;
CREATE TABLE `s_refund_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '退款日志id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
D
devil 已提交
1527 1528
  `business_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '业务订单id',
  `business_type` char(180) NOT NULL DEFAULT '' COMMENT '业务类型,字符串(如:订单、钱包充值、会员购买、等...)',
D
devil_gong 已提交
1529 1530 1531
  `trade_no` char(100) NOT NULL DEFAULT '' COMMENT '支付平台交易号',
  `buyer_user` char(60) NOT NULL DEFAULT '' COMMENT '支付平台用户帐号',
  `refund_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '退款金额',
D
devil_gong 已提交
1532
  `pay_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '订单实际支付金额',
D
devil_gong 已提交
1533 1534 1535
  `msg` char(255) NOT NULL DEFAULT '' COMMENT '描述',
  `payment` char(60) NOT NULL DEFAULT '' COMMENT '支付方式标记',
  `payment_name` char(60) NOT NULL DEFAULT '' COMMENT '支付方式名称',
D
devil_gong 已提交
1536
  `refundment` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '退款类型(0原路退回, 1退至钱包, 2手动处理)',
D
devil_gong 已提交
1537 1538 1539
  `return_params` text COMMENT '支付平台返回参数(以json存储)',
  `add_time` int(11) unsigned NOT NULL COMMENT '添加时间',
  PRIMARY KEY (`id`),
D
1.8.1  
devil 已提交
1540
  KEY `payment` (`payment`),
D
devil 已提交
1541 1542
  KEY `business_id` (`business_id`),
  KEY `business_type` (`business_type`)
D
v1.9.1  
devil 已提交
1543
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='退款日志';
D
devil_gong 已提交
1544

D
v1.2.0  
devil_gong 已提交
1545
-- ----------------------------
D
Devil 已提交
1546
-- Table structure for s_region
D
v1.2.0  
devil_gong 已提交
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562
-- ----------------------------
DROP TABLE IF EXISTS `s_region`;
CREATE TABLE `s_region` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
  `level` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT '级别类型(1:一级[所有省], 2:二级[所有市], 3:三级[所有区县], 4:街道[所有街道])',
  `letters` char(3) NOT NULL DEFAULT '' COMMENT '城市首字母',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `pid` (`pid`),
  KEY `is_enable` (`is_enable`),
  KEY `sort` (`sort`)
D
devil 已提交
1563
) ENGINE=MyISAM AUTO_INCREMENT=45065 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='地区';
D
v1.2.0  
devil_gong 已提交
1564 1565

-- ----------------------------
D
Devil 已提交
1566
-- Table structure for s_role
D
v1.2.0  
devil_gong 已提交
1567 1568 1569 1570 1571 1572 1573
-- ----------------------------
DROP TABLE IF EXISTS `s_role`;
CREATE TABLE `s_role` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '角色组id',
  `name` char(30) NOT NULL DEFAULT '' COMMENT '角色名称',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
D
devil 已提交
1574
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
D
v1.2.0  
devil_gong 已提交
1575
  PRIMARY KEY (`id`)
D
sql  
devil 已提交
1576
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='角色组';
D
v1.2.0  
devil_gong 已提交
1577 1578

-- ----------------------------
D
Devil 已提交
1579
-- Table structure for s_role_power
D
v1.2.0  
devil_gong 已提交
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589
-- ----------------------------
DROP TABLE IF EXISTS `s_role_power`;
CREATE TABLE `s_role_power` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '关联id',
  `role_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '角色id',
  `power_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '权限id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`),
  KEY `power_id` (`power_id`)
D
sql  
Devil 已提交
1590
) ENGINE=InnoDB AUTO_INCREMENT=3562 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='角色与权限管理';
D
v1.2.0  
devil_gong 已提交
1591 1592

-- ----------------------------
D
Devil 已提交
1593
-- Table structure for s_screening_price
D
v1.2.0  
devil_gong 已提交
1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611
-- ----------------------------
DROP TABLE IF EXISTS `s_screening_price`;
CREATE TABLE `s_screening_price` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类id',
  `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父id',
  `name` char(30) CHARACTER SET utf8 NOT NULL COMMENT '名称',
  `min_price` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最小价格',
  `max_price` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大价格',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '顺序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `pid` (`pid`),
  KEY `is_enable` (`is_enable`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='筛选价格';

-- ----------------------------
D
Devil 已提交
1612
-- Table structure for s_search_history
D
v1.2.0  
devil_gong 已提交
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626
-- ----------------------------
DROP TABLE IF EXISTS `s_search_history`;
CREATE TABLE `s_search_history` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `brand_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '品牌id',
  `category_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分类id',
  `keywords` char(80) NOT NULL DEFAULT '' COMMENT '搜索关键字',
  `screening_price` char(80) NOT NULL DEFAULT '' COMMENT '搜索价格区间',
  `order_by_field` char(60) NOT NULL DEFAULT '' COMMENT '排序类型(字段名称)',
  `order_by_type` char(60) NOT NULL DEFAULT '' COMMENT '排序方式(asc, desc)',
  `ymd` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '日期 ymd',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`)
D
sql  
Devil 已提交
1627
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='搜索日志';
D
devil_gong 已提交
1628

D
v1.2.0  
devil_gong 已提交
1629
-- ----------------------------
D
Devil 已提交
1630
-- Table structure for s_slide
D
v1.2.0  
devil_gong 已提交
1631 1632 1633 1634
-- ----------------------------
DROP TABLE IF EXISTS `s_slide`;
CREATE TABLE `s_slide` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
D
sql  
devil 已提交
1635
  `platform` char(30) NOT NULL DEFAULT 'pc' COMMENT '所属平台(pc PC网站, h5 H5手机网站, ios 苹果APP, android 安卓APP, alipay 支付宝小程序, weixin 微信小程序, baidu 百度小程序, toutiao 头条小程序, qq QQ小程序)',
D
v1.2.0  
devil_gong 已提交
1636 1637 1638
  `event_type` tinyint(2) NOT NULL DEFAULT '-1' COMMENT '事件类型(0 WEB页面, 1 内部页面(小程序或APP内部地址), 2 外部小程序(同一个主体下的小程序appid), 3 打开地图, 4 拨打电话)',
  `event_value` char(255) NOT NULL DEFAULT '' COMMENT '事件值',
  `images_url` char(255) NOT NULL DEFAULT '' COMMENT '图片地址',
D
sql  
devil 已提交
1639
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
D
v1.2.0  
devil_gong 已提交
1640 1641 1642 1643 1644 1645 1646 1647 1648
  `bg_color` char(30) NOT NULL DEFAULT '' COMMENT 'css背景色值',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `sort` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `is_enable` (`is_enable`),
  KEY `sort` (`sort`),
  KEY `platform` (`platform`)
D
sql  
devil 已提交
1649
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='轮播图片';
D
v1.2.0  
devil_gong 已提交
1650 1651

-- ----------------------------
D
Devil 已提交
1652
-- Table structure for s_user
D
v1.2.0  
devil_gong 已提交
1653 1654 1655 1656 1657 1658
-- ----------------------------
DROP TABLE IF EXISTS `s_user`;
CREATE TABLE `s_user` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `alipay_openid` char(60) NOT NULL DEFAULT '' COMMENT '支付宝openid',
  `weixin_openid` char(60) NOT NULL DEFAULT '' COMMENT '微信openid',
D
Devil 已提交
1659
  `weixin_unionid` char(60) NOT NULL DEFAULT '' COMMENT '微信unionid',
G
gongfuxiang 已提交
1660
  `weixin_web_openid` char(60) NOT NULL DEFAULT '' COMMENT '微信web用户openid',
D
v1.2.0  
devil_gong 已提交
1661
  `baidu_openid` char(60) NOT NULL DEFAULT '' COMMENT '百度openid',
D
Devil 已提交
1662
  `toutiao_openid` char(60) NOT NULL DEFAULT '' COMMENT '百度openid',
D
sql  
devil_gong 已提交
1663 1664
  `qq_openid` char(60) NOT NULL DEFAULT '' COMMENT 'QQopenid',
  `qq_unionid` char(60) NOT NULL DEFAULT '' COMMENT 'QQunionid',
G
gongfuxiang 已提交
1665
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0正常, 1禁止发言, 2禁止登录)',
D
v1.2.0  
devil_gong 已提交
1666 1667
  `salt` char(32) NOT NULL DEFAULT '' COMMENT '配合密码加密串',
  `pwd` char(32) NOT NULL DEFAULT '' COMMENT '登录密码',
G
gongfuxiang 已提交
1668
  `token` char(60) NOT NULL DEFAULT '' COMMENT 'token',
D
v1.2.0  
devil_gong 已提交
1669 1670 1671 1672 1673 1674 1675 1676 1677 1678
  `username` char(60) NOT NULL DEFAULT '' COMMENT '用户名',
  `nickname` char(60) NOT NULL DEFAULT '' COMMENT '用户昵称',
  `mobile` char(11) NOT NULL DEFAULT '' COMMENT '手机号码',
  `email` char(60) NOT NULL DEFAULT '' COMMENT '电子邮箱(最大长度60个字符)',
  `gender` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别(0保密,1女,2男)',
  `avatar` char(255) NOT NULL DEFAULT '' COMMENT '用户头像地址',
  `province` char(60) NOT NULL DEFAULT '' COMMENT '所在省',
  `city` char(60) NOT NULL DEFAULT '' COMMENT '所在市',
  `birthday` int(11) NOT NULL DEFAULT '0' COMMENT '生日',
  `address` char(150) NOT NULL DEFAULT '' COMMENT '详细地址',
D
devil 已提交
1679 1680
  `integral` int(10) NOT NULL DEFAULT '0' COMMENT '有效积分',
  `locking_integral` int(10) NOT NULL DEFAULT '0' COMMENT '锁定积分',
D
v1.2.0  
devil_gong 已提交
1681
  `referrer` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '推荐人用户id',
D
Devil 已提交
1682
  `plugins_distribution_level` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分销等级',
D
v1.2.0  
devil_gong 已提交
1683 1684 1685 1686 1687 1688 1689
  `is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否已删除(0否, 大于0删除时间)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `alipay_openid` (`alipay_openid`),
  KEY `weixin_openid` (`weixin_openid`),
  KEY `mobile` (`mobile`),
G
gongfuxiang 已提交
1690 1691 1692
  KEY `username` (`username`),
  KEY `token` (`token`),
  KEY `baidu_openid` (`baidu_openid`)
D
Devil 已提交
1693
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户';
D
v1.2.0  
devil_gong 已提交
1694 1695

-- ----------------------------
D
Devil 已提交
1696
-- Table structure for s_user_address
D
v1.2.0  
devil_gong 已提交
1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708
-- ----------------------------
DROP TABLE IF EXISTS `s_user_address`;
CREATE TABLE `s_user_address` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '站点id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '站点所属用户id',
  `alias` char(60) NOT NULL DEFAULT '' COMMENT '别名',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '姓名',
  `tel` char(15) NOT NULL DEFAULT '' COMMENT '电话',
  `province` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在省',
  `city` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在市',
  `county` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在县/区',
  `address` char(80) NOT NULL DEFAULT '' COMMENT '详细地址',
D
sql  
devil 已提交
1709 1710
  `lng` decimal(13,10) NOT NULL DEFAULT '0.0000000000' COMMENT '经度',
  `lat` decimal(13,10) NOT NULL DEFAULT '0.0000000000' COMMENT '纬度',
D
devil 已提交
1711 1712 1713 1714
  `idcard_name` char(60) NOT NULL DEFAULT '' COMMENT '身份证姓名',
  `idcard_number` char(30) NOT NULL DEFAULT '' COMMENT '身份证号码',
  `idcard_front` char(255) NOT NULL DEFAULT '' COMMENT '身份证人像面图片',
  `idcard_back` char(255) NOT NULL DEFAULT '' COMMENT '身份证国微面图片',
D
应用  
devil_gong 已提交
1715
  `is_default` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否默认地址(0否, 1是)',
D
v1.2.0  
devil_gong 已提交
1716 1717 1718 1719 1720
  `is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除(0否,1删除时间戳)',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
D
sql  
devil_gong 已提交
1721
  KEY `is_delete_time` (`is_delete_time`) USING BTREE
D
sql  
Devil 已提交
1722
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户地址';
D
v1.2.0  
devil_gong 已提交
1723 1724

-- ----------------------------
D
Devil 已提交
1725
-- Table structure for s_user_integral_log
D
v1.2.0  
devil_gong 已提交
1726 1727 1728 1729 1730 1731
-- ----------------------------
DROP TABLE IF EXISTS `s_user_integral_log`;
CREATE TABLE `s_user_integral_log` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '操作类型(0减少, 1增加)',
D
devil 已提交
1732 1733
  `original_integral` int(11) NOT NULL DEFAULT '0' COMMENT '原始积分',
  `new_integral` int(11) NOT NULL DEFAULT '0' COMMENT '最新积分',
D
devil 已提交
1734
  `operation_integral` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作积分',
D
v1.2.0  
devil_gong 已提交
1735 1736 1737 1738 1739
  `msg` char(255) DEFAULT '' COMMENT '操作原因',
  `operation_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作人员id',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
D
Devil 已提交
1740
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='用户积分日志';
D
v1.2.0  
devil_gong 已提交
1741

D
devil 已提交
1742
-- ----------------------------
D
Devil 已提交
1743
-- Table structure for s_warehouse
D
devil 已提交
1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757
-- ----------------------------
DROP TABLE IF EXISTS `s_warehouse`;
CREATE TABLE `s_warehouse` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` char(60) NOT NULL DEFAULT '' COMMENT '名称',
  `alias` char(60) NOT NULL DEFAULT '' COMMENT '别名',
  `level` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '权重(数字越大权重越高)',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
  `contacts_name` char(60) NOT NULL DEFAULT '' COMMENT '联系人姓名',
  `contacts_tel` char(15) NOT NULL DEFAULT '' COMMENT '联系电话',
  `province` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在省',
  `city` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在市',
  `county` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '所在县/区',
  `address` char(80) NOT NULL DEFAULT '' COMMENT '详细地址',
D
sql  
devil 已提交
1758 1759
  `lng` decimal(13,10) NOT NULL DEFAULT '0.0000000000' COMMENT '经度',
  `lat` decimal(13,10) NOT NULL DEFAULT '0.0000000000' COMMENT '纬度',
D
devil 已提交
1760
  `is_default` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否默认(0否, 1是)',
D
devil 已提交
1761
  `is_delete_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除(0否,大于0删除时间戳)',
D
devil 已提交
1762 1763 1764 1765 1766
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `level` (`level`),
D
devil 已提交
1767 1768 1769
  KEY `is_enable` (`is_enable`),
  KEY `is_default` (`is_default`),
  KEY `is_delete_time` (`is_delete_time`)
D
devil 已提交
1770
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='仓库';
D
devil 已提交
1771 1772

-- ----------------------------
D
Devil 已提交
1773
-- Table structure for s_warehouse_goods
D
devil 已提交
1774 1775 1776 1777 1778 1779 1780
-- ----------------------------
DROP TABLE IF EXISTS `s_warehouse_goods`;
CREATE TABLE `s_warehouse_goods` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `warehouse_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '仓库id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  `is_enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用(0否,1是)',
1781
  `inventory` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总库存',
D
devil 已提交
1782 1783 1784 1785 1786
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  `upd_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `warehouse_id` (`warehouse_id`),
  KEY `goods_id` (`goods_id`),
1787 1788
  KEY `is_enable` (`is_enable`),
  KEY `inventory` (`inventory`)
D
sql  
Devil 已提交
1789
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='仓库商品';
D
devil 已提交
1790 1791

-- ----------------------------
D
Devil 已提交
1792
-- Table structure for s_warehouse_goods_spec
D
devil 已提交
1793 1794 1795 1796
-- ----------------------------
DROP TABLE IF EXISTS `s_warehouse_goods_spec`;
CREATE TABLE `s_warehouse_goods_spec` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
1797
  `warehouse_goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '仓库商品id',
D
devil 已提交
1798 1799
  `warehouse_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '仓库id',
  `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
1800 1801
  `md5_key` char(32) NOT NULL DEFAULT '' COMMENT 'md5key值',
  `spec` text COMMENT '规格值',
D
devil 已提交
1802 1803 1804
  `inventory` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '库存',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
  PRIMARY KEY (`id`),
1805
  KEY `warehouse_goods_id` (`warehouse_goods_id`),
D
devil 已提交
1806 1807
  KEY `warehouse_id` (`warehouse_id`),
  KEY `goods_id` (`goods_id`),
1808
  KEY `md5_key` (`md5_key`),
D
devil 已提交
1809
  KEY `inventory` (`inventory`)
D
sql  
Devil 已提交
1810
) ENGINE=InnoDB AUTO_INCREMENT=1305 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='仓库商品规格';
1811

D
v1.2.0  
devil_gong 已提交
1812
SET FOREIGN_KEY_CHECKS = 1;