-
Notifications
You must be signed in to change notification settings - Fork 764
数据字典
张先生 edited this page Aug 20, 2020
·
2 revisions
文章管理表
CREATE TABLE `eb_article` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '文章管理ID',
`cid` varchar(255) NOT NULL DEFAULT '' COMMENT '分类id',
`title` varchar(255) NOT NULL COMMENT '文章标题',
`author` varchar(255) DEFAULT '' COMMENT '文章作者',
`image_input` varchar(255) NOT NULL COMMENT '文章图片',
`synopsis` varchar(255) DEFAULT '' COMMENT '文章简介',
`share_title` varchar(255) DEFAULT '' COMMENT '文章分享标题',
`share_synopsis` varchar(255) DEFAULT '' COMMENT '文章分享简介',
`visit` varchar(255) DEFAULT '' COMMENT '浏览次数',
`sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
`url` varchar(255) DEFAULT '' COMMENT '原文链接',
`media_id` varchar(100) DEFAULT NULL COMMENT '微信素材id',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态',
`hide` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否隐藏',
`admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员id',
`mer_id` int(10) unsigned DEFAULT '0' COMMENT '商户id',
`product_id` int(10) NOT NULL DEFAULT '0' COMMENT '商品关联id',
`is_hot` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否热门(小程序)',
`is_banner` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否轮播图(小程序)',
`content` text NOT NULL COMMENT '文章内容',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COMMENT='文章管理表';
分类表
CREATE TABLE `eb_category` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父级ID',
`path` varchar(255) NOT NULL DEFAULT '/0/' COMMENT '路径',
`name` varchar(50) NOT NULL COMMENT '分类名称',
`type` smallint(2) DEFAULT '1' COMMENT '类型,1 产品分类,2 附件分类,3 文章分类, 4 设置分类, 5 菜单分类',
`url` varchar(255) DEFAULT '' COMMENT '地址',
`extra` text COMMENT '扩展字段 Jsos格式',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态, 1正常,0失效',
`sort` int(5) NOT NULL DEFAULT '99999' COMMENT '排序',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `status+pid` (`pid`,`status`),
KEY `id+status+url` (`path`)
) ENGINE=InnoDB AUTO_INCREMENT=305 DEFAULT CHARSET=utf8 COMMENT='分类表';
快递公司表
CREATE TABLE `eb_express` (
`id` mediumint(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '快递公司id',
`code` varchar(50) NOT NULL DEFAULT '' COMMENT '快递公司简称',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '快递公司全称',
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
`is_show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否显示',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `code` (`code`) USING BTREE,
KEY `is_show` (`is_show`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=426 DEFAULT CHARSET=utf8 COMMENT='快递公司表';
运费模板
CREATE TABLE `eb_shipping_templates` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
`name` varchar(255) NOT NULL COMMENT '模板名称',
`type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '计费方式',
`appoint` tinyint(1) NOT NULL DEFAULT '0' COMMENT '指定包邮',
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='运费模板';
运费模板包邮
CREATE TABLE `eb_shipping_templates_free` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
`temp_id` int(11) NOT NULL DEFAULT '0' COMMENT '模板ID',
`city_id` int(11) NOT NULL DEFAULT '0' COMMENT '城市ID',
`title` text COMMENT '描述',
`number` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '包邮件数',
`price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '包邮金额',
`type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '计费方式',
`uniqid` varchar(32) NOT NULL DEFAULT '' COMMENT '分组唯一值',
`status` tinyint(1) DEFAULT '0' COMMENT '是否无效',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='运费模板包邮';
运费模板指定区域费用
CREATE TABLE `eb_shipping_templates_region` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',
`temp_id` int(11) NOT NULL DEFAULT '0' COMMENT '模板ID',
`city_id` int(11) NOT NULL DEFAULT '0' COMMENT '城市ID',
`title` text COMMENT '描述',
`first` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '首件',
`first_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '首件运费',
`renewal` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '续件',
`renewal_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '续件运费',
`type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '计费方式',
`uniqid` varchar(32) NOT NULL DEFAULT '' COMMENT '分组唯一值',
`status` tinyint(1) DEFAULT '0' COMMENT '是否无效',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='运费模板指定区域费用';
短信发送记录表
CREATE TABLE `eb_sms_record` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '短信发送记录编号',
`uid` varchar(255) NOT NULL COMMENT '短信平台账号',
`phone` char(11) NOT NULL COMMENT '接受短信的手机号',
`content` text NOT NULL COMMENT '短信内容',
`add_ip` varchar(30) DEFAULT NULL COMMENT '添加记录ip',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`template` varchar(255) NOT NULL COMMENT '短信模板ID',
`resultcode` int(6) unsigned NOT NULL COMMENT '状态码 100=成功,130=失败,131=空号,132=停机,133=关机,134=无状态',
`record_id` int(11) unsigned NOT NULL COMMENT '发送记录id',
`memo` text COMMENT '短信平台返回信息',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='短信发送记录表';
购物车表
CREATE TABLE `eb_store_cart` (
`id` bigint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '购物车表ID',
`uid` int(10) unsigned NOT NULL COMMENT '用户ID',
`type` varchar(32) NOT NULL COMMENT '类型',
`product_id` int(10) unsigned NOT NULL COMMENT '商品ID',
`product_attr_unique` varchar(16) NOT NULL DEFAULT '' COMMENT '商品属性',
`cart_num` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '商品数量',
`is_new` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为立即购买',
`combination_id` int(11) unsigned DEFAULT '0' COMMENT '拼团id',
`seckill_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '秒杀商品ID',
`bargain_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '砍价id',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '已添加的商品是否有效状态',
PRIMARY KEY (`id`) USING BTREE,
KEY `user_id` (`uid`) USING BTREE,
KEY `goods_id` (`product_id`) USING BTREE,
KEY `uid` (`uid`) USING BTREE,
KEY `uid_2` (`uid`) USING BTREE,
KEY `uid_3` (`uid`,`is_new`) USING BTREE,
KEY `type` (`type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='购物车表';
优惠券表
CREATE TABLE `eb_store_coupon` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '优惠券表ID',
`name` varchar(64) NOT NULL DEFAULT '' COMMENT '优惠券名称',
`money` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '兑换的优惠券面值',
`is_limited` tinyint(1) DEFAULT '0' COMMENT '是否限量, 默认0 不限量, 1限量',
`total` int(11) NOT NULL DEFAULT '0' COMMENT '发放总数',
`last_total` int(11) DEFAULT '0' COMMENT '剩余数量',
`use_type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '使用类型 1 全场通用, 2 商品券, 3 品类券',
`primary_key` varchar(255) NOT NULL DEFAULT '' COMMENT '所属商品id / 分类id',
`min_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低消费,0代表不限制',
`receive_start_time` timestamp NOT NULL COMMENT '可领取开始时间',
`receive_end_time` timestamp NULL DEFAULT NULL COMMENT '可领取结束时间',
`is_fixed_time` tinyint(1) DEFAULT '0' COMMENT '是否固定使用时间, 默认0 否, 1是',
`use_start_time` timestamp NULL DEFAULT NULL COMMENT '可使用时间范围 开始时间',
`use_end_time` timestamp NULL DEFAULT NULL COMMENT '可使用时间范围 结束时间',
`day` int(4) DEFAULT '0' COMMENT '天数',
`type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '优惠券类型 1 手动领取, 2 新人券, 3 赠送券',
`sort` int(11) unsigned NOT NULL DEFAULT '1' COMMENT '排序',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(0:关闭,1:开启)',
`is_del` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除 状态(0:否,1:是)',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `state` (`status`) USING BTREE,
KEY `is_del` (`is_del`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券表';
优惠券记录表
CREATE TABLE `eb_store_coupon_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`coupon_id` int(10) NOT NULL COMMENT '优惠券发布id',
`cid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '兑换的项目id',
`uid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '领取人id',
`name` varchar(32) NOT NULL DEFAULT '' COMMENT '优惠券名称',
`money` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券的面值',
`min_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '最低消费多少金额可用优惠券',
`type` varchar(32) NOT NULL DEFAULT 'send' COMMENT '获取方式,send后台发放, 用户领取 get',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态(0:未使用,1:已使用, 2:已失效)',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`start_time` timestamp NULL DEFAULT NULL COMMENT '开始使用时间',
`end_time` timestamp NULL DEFAULT NULL COMMENT '过期时间',
`use_time` timestamp NULL DEFAULT NULL COMMENT '使用时间',
`use_type` tinyint(1) DEFAULT '1' COMMENT '使用类型 1 全场通用, 2 商品券, 3 品类券',
`primary_key` varchar(255) DEFAULT NULL COMMENT '所属商品id / 分类id',
PRIMARY KEY (`id`) USING BTREE,
KEY `cid` (`cid`) USING BTREE,
KEY `uid` (`uid`) USING BTREE,
KEY `end_time` (`end_time`) USING BTREE,
KEY `status` (`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券记录表';
订单表
CREATE TABLE `eb_store_order` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID',
`order_id` varchar(32) NOT NULL COMMENT '订单号',
`uid` int(11) unsigned NOT NULL COMMENT '用户id',
`real_name` varchar(32) NOT NULL COMMENT '用户姓名',
`user_phone` varchar(18) NOT NULL COMMENT '用户电话',
`user_address` varchar(100) NOT NULL COMMENT '详细地址',
`freight_price` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '运费金额',
`total_num` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '订单商品总数',
`total_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '订单总价',
`total_postage` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '邮费',
`pay_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际支付金额',
`pay_postage` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付邮费',
`deduction_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '抵扣金额',
`coupon_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券id',
`coupon_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券金额',
`paid` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态',
`pay_time` timestamp NULL DEFAULT NULL COMMENT '支付时间',
`pay_type` varchar(32) NOT NULL COMMENT '支付方式',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态(-1 : 申请退款 -2 : 退货成功 0:待发货;1:待收货;2:已收货,待评价;3:已完成;)',
`refund_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 未退款 1 申请中 2 已退款',
`refund_reason_wap_img` varchar(255) DEFAULT NULL COMMENT '退款图片',
`refund_reason_wap_explain` varchar(255) DEFAULT NULL COMMENT '退款用户说明',
`refund_reason_wap` varchar(255) DEFAULT NULL COMMENT '前台退款原因',
`refund_reason` varchar(255) DEFAULT NULL COMMENT '不退款的理由',
`refund_reason_time` timestamp NULL DEFAULT NULL COMMENT '退款时间',
`refund_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',
`delivery_name` varchar(64) DEFAULT NULL COMMENT '快递名称/送货人姓名',
`delivery_type` varchar(32) DEFAULT NULL COMMENT '发货类型',
`delivery_id` varchar(64) DEFAULT NULL COMMENT '快递单号/手机号',
`gain_integral` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费赚取积分',
`use_integral` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '使用积分',
`back_integral` decimal(8,2) unsigned DEFAULT NULL COMMENT '给用户退了多少积分',
`mark` varchar(512) NOT NULL COMMENT '备注',
`is_del` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',
`unique` char(32) NOT NULL COMMENT '唯一id(md5加密)类似id',
`remark` varchar(512) DEFAULT NULL COMMENT '管理员备注',
`mer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商户ID',
`is_mer_check` tinyint(3) unsigned NOT NULL DEFAULT '0',
`combination_id` int(11) unsigned DEFAULT '0' COMMENT '拼团商品id0一般商品',
`pink_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '拼团id 0没有拼团',
`cost` decimal(8,2) unsigned NOT NULL COMMENT '成本价',
`seckill_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '秒杀商品ID',
`bargain_id` int(11) unsigned DEFAULT '0' COMMENT '砍价id',
`verify_code` varchar(12) NOT NULL DEFAULT '' COMMENT '核销码',
`store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id',
`shipping_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '配送方式 1=快递 ,2=门店自提',
`clerk_id` int(11) NOT NULL DEFAULT '0' COMMENT '店员id',
`is_channel` tinyint(1) unsigned DEFAULT '0' COMMENT '支付渠道(0微信公众号1微信小程序)',
`is_remind` tinyint(1) unsigned DEFAULT '0' COMMENT '消息提醒',
`is_system_del` tinyint(1) DEFAULT '0' COMMENT '后台是否删除',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `order_id_2` (`order_id`,`uid`) USING BTREE,
UNIQUE KEY `unique` (`unique`) USING BTREE,
KEY `uid` (`uid`) USING BTREE,
KEY `add_time` (`create_time`) USING BTREE,
KEY `pay_price` (`pay_price`) USING BTREE,
KEY `paid` (`paid`) USING BTREE,
KEY `pay_time` (`pay_time`) USING BTREE,
KEY `pay_type` (`pay_type`) USING BTREE,
KEY `status` (`status`) USING BTREE,
KEY `is_del` (`is_del`) USING BTREE,
KEY `coupon_id` (`coupon_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单表';
订单购物详情表
CREATE TABLE `eb_store_order_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`order_id` int(11) unsigned NOT NULL COMMENT '订单id',
`product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID',
`info` text NOT NULL COMMENT '购买东西的详细信息',
`unique` char(32) NOT NULL COMMENT '唯一id',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `oid` (`order_id`,`unique`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单购物详情表';
订单操作记录表
CREATE TABLE `eb_store_order_status` (
`oid` int(10) unsigned NOT NULL COMMENT '订单id',
`change_type` varchar(32) NOT NULL COMMENT '操作类型',
`change_message` varchar(256) NOT NULL COMMENT '操作备注',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
KEY `oid` (`oid`) USING BTREE,
KEY `change_type` (`change_type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单操作记录表';
商品表
CREATE TABLE `eb_store_product` (
`id` mediumint(11) NOT NULL AUTO_INCREMENT COMMENT '商品id',
`mer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商户Id(0为总后台管理员创建,不为0的时候是商户后台创建)',
`image` varchar(256) NOT NULL COMMENT '商品图片',
`slider_image` varchar(2000) NOT NULL COMMENT '轮播图',
`store_name` varchar(128) NOT NULL COMMENT '商品名称',
`store_info` varchar(256) NOT NULL COMMENT '商品简介',
`keyword` varchar(256) NOT NULL COMMENT '关键字',
`bar_code` varchar(15) NOT NULL DEFAULT '' COMMENT '商品条码(一维码)',
`cate_id` varchar(64) NOT NULL COMMENT '分类id',
`price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品价格',
`vip_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '会员价格',
`ot_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '市场价',
`postage` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '邮费',
`unit_name` varchar(32) NOT NULL COMMENT '单位名',
`sort` smallint(11) NOT NULL DEFAULT '0' COMMENT '排序',
`sales` mediumint(11) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
`stock` mediumint(11) unsigned NOT NULL DEFAULT '0' COMMENT '库存',
`is_show` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0:未上架,1:上架)',
`is_hot` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否热卖',
`is_benefit` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否优惠',
`is_best` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否精品',
`is_new` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否新品',
`add_time` int(11) unsigned NOT NULL COMMENT '添加时间',
`is_postage` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否包邮',
`is_del` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',
`mer_use` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '商户是否代理 0不可代理1可代理',
`give_integral` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '获得积分',
`cost` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '成本价',
`is_seckill` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '秒杀状态 0 未开启 1已开启',
`is_bargain` tinyint(1) unsigned DEFAULT NULL COMMENT '砍价状态 0未开启 1开启',
`is_good` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否优品推荐',
`is_sub` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否单独分佣',
`ficti` mediumint(11) DEFAULT '100' COMMENT '虚拟销量',
`browse` int(11) DEFAULT '0' COMMENT '浏览量',
`code_path` varchar(64) NOT NULL DEFAULT '' COMMENT '商品二维码地址(用户小程序海报)',
`soure_link` varchar(255) DEFAULT '' COMMENT '淘宝京东1688类型',
`video_link` varchar(200) NOT NULL DEFAULT '' COMMENT '主图视频链接',
`temp_id` int(11) NOT NULL DEFAULT '1' COMMENT '运费模板ID',
`spec_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '规格 0单 1多',
`activity` varchar(255) NOT NULL DEFAULT '' COMMENT '活动显示排序1=秒杀,2=砍价,3=拼团',
PRIMARY KEY (`id`) USING BTREE,
KEY `cate_id` (`cate_id`) USING BTREE,
KEY `is_hot` (`is_hot`) USING BTREE,
KEY `is_benefit` (`is_benefit`) USING BTREE,
KEY `is_best` (`is_best`) USING BTREE,
KEY `is_new` (`is_new`) USING BTREE,
KEY `toggle_on_sale, is_del` (`is_del`) USING BTREE,
KEY `price` (`price`) USING BTREE,
KEY `is_show` (`is_show`) USING BTREE,
KEY `sort` (`sort`) USING BTREE,
KEY `sales` (`sales`) USING BTREE,
KEY `add_time` (`add_time`) USING BTREE,
KEY `is_postage` (`is_postage`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='商品表';
**商品属性表
CREATE TABLE `eb_store_product_attr` (
`id` mediumint(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID',
`attr_name` varchar(32) NOT NULL COMMENT '属性名',
`attr_values` varchar(256) NOT NULL COMMENT '属性值',
`type` tinyint(1) DEFAULT '0' COMMENT '活动类型 0=商品,1=秒杀,2=砍价,3=拼团',
PRIMARY KEY (`id`),
KEY `store_id` (`product_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='商品属性表';
商品属性详情表
CREATE TABLE `eb_store_product_attr_result` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`product_id` int(10) unsigned NOT NULL COMMENT '商品ID',
`result` text NOT NULL COMMENT '商品属性参数',
`change_time` int(10) unsigned NOT NULL COMMENT '上次修改时间',
`type` tinyint(1) DEFAULT '0' COMMENT '活动类型 0=商品,1=秒杀,2=砍价,3=拼团',
PRIMARY KEY (`id`),
KEY `product_id` (`product_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='商品属性详情表';
商品属性值表
CREATE TABLE `eb_store_product_attr_value` (
`id` mediumint(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`product_id` int(10) unsigned NOT NULL COMMENT '商品ID',
`suk` varchar(128) NOT NULL COMMENT '商品属性索引值 (attr_value|attr_value[|....])',
`stock` int(10) unsigned NOT NULL COMMENT '属性对应的库存',
`sales` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
`price` decimal(8,2) unsigned NOT NULL COMMENT '属性金额',
`image` varchar(1000) DEFAULT NULL COMMENT '图片',
`unique` char(8) NOT NULL DEFAULT '' COMMENT '唯一值',
`cost` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '成本价',
`bar_code` varchar(50) NOT NULL DEFAULT '' COMMENT '商品条码',
`ot_price` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '原价',
`weight` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '重量',
`volume` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '体积',
`brokerage` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '一级返佣',
`brokerage_two` decimal(8,2) NOT NULL DEFAULT '0.00' COMMENT '二级返佣',
`type` tinyint(1) DEFAULT '0' COMMENT '活动类型 0=商品,1=秒杀,2=砍价,3=拼团',
`quota` int(11) DEFAULT NULL COMMENT '活动限购数量',
`quota_show` int(11) DEFAULT NULL COMMENT '活动限购数量显示',
`attr_value` text COMMENT 'attr_values 创建更新时的属性对应',
PRIMARY KEY (`id`),
KEY `unique` (`unique`,`suk`) USING BTREE,
KEY `store_id` (`product_id`,`suk`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品属性值表';
商品分类辅助表
CREATE TABLE `eb_store_product_cate` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
`cate_id` int(11) NOT NULL DEFAULT '0' COMMENT '分类id',
`add_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='商品分类辅助表';
产品优惠券
CREATE TABLE `eb_store_product_coupon` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`product_id` int(10) NOT NULL DEFAULT '0' COMMENT '商品id',
`issue_coupon_id` int(10) NOT NULL DEFAULT '0' COMMENT '优惠劵id',
`add_time` int(10) NOT NULL DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品优惠券';
产品详情
CREATE TABLE `eb_store_product_description` (
`product_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品ID',
`description` text NOT NULL COMMENT '商品详情',
`type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '商品类型',
KEY `product_id` (`product_id`,`type`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品详情';
商品点赞和收藏表
CREATE TABLE `eb_store_product_relation` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uid` int(10) unsigned NOT NULL COMMENT '用户ID',
`product_id` int(10) unsigned NOT NULL COMMENT '商品ID',
`type` varchar(32) NOT NULL COMMENT '类型(收藏(collect)、点赞(like))',
`category` varchar(32) NOT NULL COMMENT '某种类型的商品(普通商品、秒杀商品)',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uid` (`uid`,`product_id`,`type`,`category`) USING BTREE,
KEY `type` (`type`) USING BTREE,
KEY `category` (`category`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品点赞和收藏表';
评论表
CREATE TABLE `eb_store_product_reply` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '评论ID',
`uid` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`oid` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID',
`unique` varchar(32) NOT NULL COMMENT '商品唯一id',
`product_id` int(11) NOT NULL COMMENT '商品id',
`reply_type` varchar(32) NOT NULL DEFAULT 'product' COMMENT '某种商品类型(普通商品、秒杀商品)',
`product_score` tinyint(1) NOT NULL COMMENT '商品分数',
`service_score` tinyint(1) NOT NULL COMMENT '服务分数',
`comment` varchar(512) NOT NULL COMMENT '评论内容',
`pics` text NOT NULL COMMENT '评论图片',
`merchant_reply_content` varchar(300) DEFAULT NULL COMMENT '管理员回复内容',
`merchant_reply_time` int(11) DEFAULT NULL COMMENT '管理员回复时间',
`is_del` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0未删除1已删除',
`is_reply` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0未回复1已回复',
`nickname` varchar(64) NOT NULL COMMENT '用户名称',
`avatar` varchar(255) NOT NULL COMMENT '用户头像',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `parent_id` (`reply_type`) USING BTREE,
KEY `is_del` (`is_del`) USING BTREE,
KEY `product_score` (`product_score`) USING BTREE,
KEY `service_score` (`service_score`) USING BTREE,
KEY `uid+oid` (`uid`,`oid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='评论表';
商品规则值(规格)表
CREATE TABLE `eb_store_product_rule` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`rule_name` varchar(32) NOT NULL COMMENT '规格名称',
`rule_value` text NOT NULL COMMENT '规格值',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='商品规则值(规格)表';
后台管理员表
CREATE TABLE `eb_system_admin` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '后台管理员表ID',
`account` varchar(32) NOT NULL COMMENT '后台管理员账号',
`pwd` char(32) NOT NULL COMMENT '后台管理员密码',
`real_name` varchar(16) NOT NULL COMMENT '后台管理员姓名',
`roles` varchar(128) NOT NULL COMMENT '后台管理员权限(menus_id)',
`last_ip` varchar(16) DEFAULT NULL COMMENT '后台管理员最后一次登录ip',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`login_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '登录次数',
`level` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '后台管理员级别',
`status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '后台管理员状态 1有效0无效',
`is_del` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE,
KEY `account` (`account`) USING BTREE,
KEY `status` (`status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='后台管理员表';
附件管理表
CREATE TABLE `eb_system_attachment` (
`att_id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '附件名称',
`att_dir` varchar(200) NOT NULL DEFAULT '' COMMENT '附件路径',
`satt_dir` varchar(200) DEFAULT NULL COMMENT '压缩图片路径',
`att_size` char(30) NOT NULL DEFAULT '' COMMENT '附件大小',
`att_type` char(30) NOT NULL DEFAULT '' COMMENT '附件类型',
`pid` int(10) NOT NULL DEFAULT '0' COMMENT '分类ID0编辑器,1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图, 7前台用户',
`image_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '图片上传类型 1本地 2七牛云 3OSS 4COS ',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`att_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附件管理表';
城市表
CREATE TABLE `eb_system_city` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`city_id` int(11) NOT NULL DEFAULT '0' COMMENT '城市id',
`level` int(11) NOT NULL DEFAULT '0' COMMENT '省市级别',
`parent_id` int(11) NOT NULL DEFAULT '0' COMMENT '父级id',
`area_code` varchar(30) NOT NULL DEFAULT '' COMMENT '区号',
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '名称',
`merger_name` varchar(255) NOT NULL DEFAULT '' COMMENT '合并名称',
`lng` varchar(50) NOT NULL DEFAULT '' COMMENT '经度',
`lat` varchar(50) NOT NULL DEFAULT '' COMMENT '纬度',
`is_show` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否展示',
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3971 DEFAULT CHARSET=utf8 COMMENT='城市表';
配置表
CREATE TABLE `eb_system_config` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '配置id',
`name` varchar(500) NOT NULL DEFAULT '' COMMENT '字段名称',
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '字段提示文字',
`form_id` int(10) DEFAULT '0' COMMENT '表单id',
`value` varchar(5000) DEFAULT '' COMMENT '值',
`status` tinyint(1) DEFAULT '0' COMMENT '是否隐藏',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `status+name` (`name`),
KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1635 DEFAULT CHARSET=utf8 COMMENT='配置表';
表单模板
CREATE TABLE `eb_system_form_temp` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '表单模板id',
`name` varchar(500) NOT NULL DEFAULT '' COMMENT '表单名称',
`info` varchar(500) NOT NULL DEFAULT '' COMMENT '表单简介',
`content` text NOT NULL COMMENT '表单内容',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=119 DEFAULT CHARSET=utf8 COMMENT='表单模板';