```[sql]
CREATE TABLE ns_album (
album_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
site_name varchar(255) NOT NULL DEFAULT '' COMMENT '站点名称',
album_name varchar(50) NOT NULL DEFAULT '' COMMENT '相册,名称',
sort int(11) NOT NULL DEFAULT 0 COMMENT '排序',
cover varchar(255) NOT NULL DEFAULT '' COMMENT '背景图',
`desc` varchar(255) NOT NULL DEFAULT '' COMMENT '介绍',
is_default tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否默认',
update_time int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
num int(11) NOT NULL DEFAULT 0 COMMENT '相册图片数',
PRIMARY KEY (album_id)
)
ENGINE = INNODB,
CHARACTER SET utf8,
COLLATE utf8_general_ci,
COMMENT = '相册表';
CREATE TABLE ns_album_pic (
pic_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
pic_name varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
pic_path varchar(255) NOT NULL DEFAULT '' COMMENT '路径',
pic_spec varchar(255) NOT NULL DEFAULT '' COMMENT '规格',
site_id int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
update_time int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
album_id int(11) NOT NULL DEFAULT 0 COMMENT '相册id',
PRIMARY KEY (pic_id)
)
ENGINE = INNODB,
CHARACTER SET utf8,
COLLATE utf8_general_ci,
COMMENT = '相册图片表';
-- ----------------------------
-- Table structure for ns_goods
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods`;
CREATE TABLE `ns_goods` (
`goods_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '商品id',
`goods_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品名称',
`goods_class` int(11) NOT NULL DEFAULT 1 COMMENT '商品种类1.实物商品2.虚拟商品3.卡券商品',
`goods_class_name` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品种类',
`goods_attr_class` int(11) NOT NULL DEFAULT 1 COMMENT '商品类型id',
`goods_attr_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品类型名称',
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '所属店铺id',
`site_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '所属店铺名称',
`goods_image` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品主图路径',
`goods_content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品详情',
`goods_state` tinyint(4) NOT NULL DEFAULT 1 COMMENT '商品状态(1.正常0下架)',
`category_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品分类id,逗号隔开',
`category_json` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类json字符串',
`price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '商品价格(取第一个sku)',
`market_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '市场价格(取第一个sku)',
`cost_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '成本价(取第一个sku)',
`goods_stock` int(11) NOT NULL DEFAULT 0 COMMENT '商品库存(总和)',
`goods_stock_alarm` int(11) NOT NULL DEFAULT 0 COMMENT '库存预警',
`is_virtual` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否虚拟类商品(0实物1.虚拟)',
`virtual_indate` int(11) NOT NULL DEFAULT 1 COMMENT '虚拟商品有效期',
`is_free_shipping` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否免邮',
`shipping_template` int(11) NOT NULL DEFAULT 0 COMMENT '指定运费模板',
`goods_spec_format` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品规格格式',
`goods_attr_format` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品属性格式',
`is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否已经删除',
`introduction` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '促销语',
`keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '关键词',
`unit` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '单位',
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`modify_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`video_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '视频',
`sale_num` int(11) NOT NULL DEFAULT 0 COMMENT '销量',
`evaluate` int(11) NOT NULL DEFAULT 0 COMMENT '评价数',
`evaluate_shaitu` int(11) NOT NULL DEFAULT 0 COMMENT '评价晒图数',
`evaluate_shipin` int(11) NOT NULL DEFAULT 0 COMMENT '评价视频数',
`evaluate_zhuiping` int(11) NOT NULL DEFAULT 0 COMMENT '评价追评数',
`evaluate_haoping` int(11) NOT NULL DEFAULT 0 COMMENT '评价好评数',
`evaluate_zhongping` int(11) NOT NULL DEFAULT 0 COMMENT '评价中评数',
`evaluate_chaping` int(11) NOT NULL DEFAULT 0 COMMENT '评价差评数',
`is_fenxiao` tinyint(1) NOT NULL DEFAULT 0 COMMENT '参与分销(0不参与 1参与)',
`fenxiao_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '分销佣金类型(1默认 2自行设置)',
`supplier_id` int(11) NOT NULL DEFAULT 0 COMMENT '供应商id',
`is_consume_discount` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否参与会员等级折扣',
`discount_config` tinyint(1) NOT NULL DEFAULT 0 COMMENT '优惠设置(0默认 1自定义)',
`discount_method` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '优惠方式(discount打折 manjian 满减 fixed_price 指定价格)',
`sku_id` int(11) NOT NULL DEFAULT 0 COMMENT 'sku_id',
`promotion_addon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '当前参与的营销活动,逗号分隔(限时折扣、团购、拼团、秒杀、专题活动)',
`goods_service_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品服务id',
`label_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品分组id',
`virtual_sale` int(11) NOT NULL DEFAULT 0 COMMENT '虚拟销量',
`max_buy` int(11) NOT NULL DEFAULT 0 COMMENT '限购',
`min_buy` int(11) NOT NULL DEFAULT 0 COMMENT '起购数',
PRIMARY KEY (`goods_id`) USING BTREE,
INDEX `IDX_ns_goods_category_id`(`category_id`) USING BTREE,
INDEX `IDX_ns_goods_goods_class`(`goods_class`) USING BTREE,
INDEX `IDX_ns_goods_is_delete`(`is_delete`) USING BTREE,
INDEX `IDX_ns_goods_site_id`(`site_id`) USING BTREE,
INDEX `IDX_ns_goods_sku_id`(`sku_id`) USING BTREE,
INDEX `IDX_ns_goods_sort`(`sort`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 AVG_ROW_LENGTH = 2891 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品表' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_attr_class
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_attr_class`;
CREATE TABLE `ns_goods_attr_class` (
`class_id` int(11) NOT NULL AUTO_INCREMENT,
`class_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '类型名称',
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '所属店铺id',
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序号',
PRIMARY KEY (`class_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 8192 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = ' 商品类型' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_attribute
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_attribute`;
CREATE TABLE `ns_goods_attribute` (
`attr_id` int(11) NOT NULL AUTO_INCREMENT,
`attr_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '属性名称',
`attr_class_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品类型id',
`attr_class_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品类型名称',
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '属性排序号',
`is_query` int(11) NOT NULL DEFAULT 0 COMMENT '是否参与筛选',
`is_spec` int(11) NOT NULL DEFAULT 0 COMMENT '是否是规格属性',
`attr_value_list` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '属性值列表(\',\'隔开注意键值对)',
`attr_value_format` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '属性值格式json',
`attr_type` int(11) NOT NULL DEFAULT 0 COMMENT '属性类型 (1.单选 2.多选3. 输入 注意输入不参与筛选)',
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
`site_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '店铺名称',
PRIMARY KEY (`attr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 5461 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_attribute_value
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_attribute_value`;
CREATE TABLE `ns_goods_attribute_value` (
`attr_value_id` int(11) NOT NULL AUTO_INCREMENT,
`attr_value_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '属性值名称',
`attr_id` int(11) NOT NULL DEFAULT 0 COMMENT '属性id',
`attr_class_id` int(11) NOT NULL DEFAULT 0 COMMENT '类型id',
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
PRIMARY KEY (`attr_value_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 5461 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性值表' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_browse
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_browse`;
CREATE TABLE `ns_goods_browse` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL DEFAULT 0 COMMENT '浏览人',
`browse_time` int(11) NOT NULL DEFAULT 0 COMMENT '浏览时间',
`site_id` int(10) NOT NULL DEFAULT 0 COMMENT '站点id',
`sku_id` int(11) NOT NULL DEFAULT 0 COMMENT 'sku_id',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品id',
PRIMARY KEY (`id`) USING BTREE,
INDEX `IDX_ns_goods_browse_member_id`(`member_id`) USING BTREE,
INDEX `IDX_ns_goods_browse_sku_id`(`sku_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 AVG_ROW_LENGTH = 104 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品浏览历史' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_cart
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_cart`;
CREATE TABLE `ns_goods_cart` (
`cart_id` int(11) NOT NULL AUTO_INCREMENT,
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
`member_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`sku_id` int(11) NOT NULL DEFAULT 0 COMMENT 'sku_id',
`num` int(11) NOT NULL DEFAULT 0 COMMENT '数量',
PRIMARY KEY (`cart_id`) USING BTREE,
INDEX `IDX_ns_goods_cart_member_id`(`member_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 963 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = ' 购物车' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_category
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_category`;
CREATE TABLE `ns_goods_category` (
`category_id` int(11) NOT NULL AUTO_INCREMENT,
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
`category_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类名称',
`short_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '简称',
`pid` int(11) NOT NULL DEFAULT 0 COMMENT '分类上级',
`level` int(11) NOT NULL DEFAULT 0 COMMENT '层级',
`is_show` int(11) NOT NULL DEFAULT 0 COMMENT '是否显示',
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
`image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类图片',
`keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类页面关键字',
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类介绍',
`attr_class_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联商品类型id',
`attr_class_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '关联商品类型名称',
`category_id_1` int(11) NOT NULL DEFAULT 0 COMMENT '一级分类id',
`category_id_2` int(11) NOT NULL DEFAULT 0 COMMENT '二级分类id',
`category_id_3` int(11) NOT NULL DEFAULT 0 COMMENT '三级分类id',
`category_full_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '组装名称',
`image_adv` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分类广告图',
`commission_rate` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '佣金比率%',
PRIMARY KEY (`category_id`) USING BTREE,
INDEX `pid_level`(`pid`, `level`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 21 AVG_ROW_LENGTH = 468 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = ' 商品分类' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_collect
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_collect`;
CREATE TABLE `ns_goods_collect` (
`collect_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`member_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品id',
`sku_id` int(11) NOT NULL DEFAULT 0 COMMENT 'skuid',
`category_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品分类id',
`sku_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品名称',
`sku_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '商品价格',
`sku_image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品图片',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '收藏时间',
`site_id` int(10) NOT NULL DEFAULT 0 COMMENT '站点id',
PRIMARY KEY (`collect_id`) USING BTREE,
INDEX `IDX_ns_goods_collect_member_id`(`member_id`) USING BTREE,
INDEX `IDX_ns_goods_collect_sku_id`(`sku_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 481 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品收藏表' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_evaluate
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_evaluate`;
CREATE TABLE `ns_goods_evaluate` (
`evaluate_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '评价ID',
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
`website_id` int(11) NOT NULL DEFAULT 0 COMMENT '分站id',
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '订单ID',
`order_no` bigint(20) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单编号',
`order_goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '订单项ID',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
`sku_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品skuid',
`sku_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品名称',
`sku_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '商品价格',
`sku_image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品图片',
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '评价内容',
`images` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '评价图片',
`explain_first` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '解释内容',
`member_id` int(11) NOT NULL DEFAULT 0 COMMENT '评价人id',
`member_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '评价人名称',
`member_headimg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '评价人头像',
`is_anonymous` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0表示不是 1表示是匿名评价',
`scores` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1-5分',
`again_content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '追加评价内容',
`again_images` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '追评评价图片',
`again_explain` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '追加解释内容',
`explain_type` int(11) NOT NULL DEFAULT 0 COMMENT '1好评2中评3差评',
`is_show` int(1) NOT NULL DEFAULT 1 COMMENT '1显示 0隐藏',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '评价时间',
`again_time` int(11) NOT NULL DEFAULT 0 COMMENT '追加评价时间',
`shop_desccredit` decimal(10,2) NOT NULL DEFAULT 5.00 COMMENT '描述分值',
`shop_servicecredit` decimal(10,2) NOT NULL DEFAULT 5.00 COMMENT '服务分值',
`shop_deliverycredit` decimal(10,2) NOT NULL DEFAULT 5.00 COMMENT '配送分值',
PRIMARY KEY (`evaluate_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 2048 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品评价表' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_label
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_label`;
CREATE TABLE `ns_goods_label` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
`label_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '标签名称',
`desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '描述',
`create_time` int(11) NOT NULL DEFAULT 0,
`update_time` int(11) NOT NULL DEFAULT 0,
`sort` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 3276 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品标签' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_service
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_service`;
CREATE TABLE `ns_goods_service` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
`service_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '服务名称',
`desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '描述',
`create_time` int(11) NOT NULL DEFAULT 0,
`update_time` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 366 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品服务' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_sku
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_sku`;
CREATE TABLE `ns_goods_sku` (
`sku_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '商品sku_id',
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '所属店铺id',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品id',
`sku_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品sku名称',
`sku_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品sku编码',
`sku_spec_format` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'sku规格格式',
`price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'sku单价',
`market_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'sku市场价',
`cost_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'sku成本价',
`discount_price` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT 'sku折扣价(默认等于单价)',
`promotion_type` tinyint(4) NOT NULL DEFAULT 0 COMMENT '活动类型1.限时折扣',
`start_time` int(11) NOT NULL DEFAULT 0 COMMENT '活动开始时间',
`end_time` int(11) NOT NULL DEFAULT 0 COMMENT '活动结束时间',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '商品sku库存',
`weight` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '重量(单位g)',
`volume` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '体积(单位立方米)',
`click_num` int(11) NOT NULL DEFAULT 0 COMMENT '点击量',
`sale_num` int(11) NOT NULL DEFAULT 0 COMMENT '销量',
`collect_num` int(11) NOT NULL DEFAULT 0 COMMENT '收藏量',
`sku_image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'sku主图',
`sku_images` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'sku图片',
`goods_class` int(11) NOT NULL DEFAULT 1 COMMENT '商品种类1.实物商品2.虚拟商品3.卡券商品',
`goods_class_name` varchar(25) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品种类',
`goods_attr_class` int(11) NOT NULL DEFAULT 1 COMMENT '商品类型id',
`goods_attr_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品类型名称',
`goods_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品名称',
`goods_content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '商品详情',
`goods_state` tinyint(4) NOT NULL DEFAULT 1 COMMENT '商品状态(1.正常0下架)',
`goods_stock_alarm` int(11) NOT NULL DEFAULT 0 COMMENT '库存预警',
`is_virtual` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否虚拟类商品(0实物1.虚拟)',
`virtual_indate` int(11) NOT NULL DEFAULT 1 COMMENT '虚拟商品有效期',
`is_free_shipping` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否免邮',
`shipping_template` int(11) NOT NULL DEFAULT 0 COMMENT '指定运费模板',
`goods_spec_format` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品规格格式',
`goods_attr_format` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品属性格式',
`is_delete` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否已经删除',
`introduction` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '促销语',
`keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '关键词',
`unit` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '单位',
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`modify_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`video_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '视频',
`evaluate` int(11) NOT NULL DEFAULT 0 COMMENT '评价数',
`evaluate_shaitu` int(11) NOT NULL DEFAULT 0 COMMENT '晒图评价数',
`evaluate_shipin` int(11) NOT NULL DEFAULT 0 COMMENT '视频评价数',
`evaluate_zhuiping` int(11) NOT NULL DEFAULT 0 COMMENT '追评数',
`spec_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规格名称',
`evaluate_haoping` int(11) NOT NULL DEFAULT 0 COMMENT '好评数',
`evaluate_zhongping` int(11) NOT NULL DEFAULT 0 COMMENT '中评数',
`evaluate_chaping` int(11) NOT NULL DEFAULT 0 COMMENT '差评数',
`supplier_id` int(11) NOT NULL DEFAULT 0 COMMENT '供应商id',
`is_consume_discount` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否参与会员等级折扣',
`discount_config` tinyint(1) NOT NULL DEFAULT 0 COMMENT '优惠设置(0默认 1自定义)',
`discount_method` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '优惠方式(discount打折 manjian 满减 fixed_price 指定价格)',
`member_price` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '会员价',
`goods_service_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品服务id',
`virtual_sale` int(11) NOT NULL DEFAULT 0 COMMENT '虚拟销量',
`max_buy` int(11) NOT NULL DEFAULT 0 COMMENT '限购',
`min_buy` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`sku_id`) USING BTREE,
INDEX `IDX_ns_goods_goods_class`(`goods_class`) USING BTREE,
INDEX `IDX_ns_goods_is_delete`(`is_delete`) USING BTREE,
INDEX `IDX_ns_goods_site_id`(`site_id`) USING BTREE,
INDEX `IDX_ns_goods_sort`(`sort`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 48 AVG_ROW_LENGTH = 12920 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品表' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_goods_virtual
-- ----------------------------
DROP TABLE IF EXISTS `ns_goods_virtual`;
CREATE TABLE `ns_goods_virtual` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '店铺id',
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
`order_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '订单编号',
`sku_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品sku_id',
`sku_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '商品名称',
`code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '虚拟商品编码',
`is_veirfy` int(11) NOT NULL DEFAULT 0 COMMENT '是否已经核销',
`verify_time` int(11) NOT NULL DEFAULT 0 COMMENT '核销时间',
`member_id` int(11) NOT NULL DEFAULT 0 COMMENT '所属人',
`sku_image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '虚拟商品图片',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 AVG_ROW_LENGTH = 528 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户虚拟商品表' ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for ns_supplier
-- ----------------------------
DROP TABLE IF EXISTS `ns_supplier`;
CREATE TABLE `ns_supplier` (
`supplier_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`supplier_site_id` int(10) NOT NULL DEFAULT 0 COMMENT '供应商站点',
`title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '供应商名称',
`logo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '供应商logo',
`desc` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '供应商简介',
`keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '供应商关键字',
`supplier_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '供应商地址',
`supplier_email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '供应商邮箱',
`supplier_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '联系电话',
`supplier_qq` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '供应商qq',
`supplier_weixin` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '联系人微信号',
`account` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '账户金额',
`account_withdraw` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '已提现金额',
`account_withdraw_apply` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '提现中金额',
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`modify_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'admin' COMMENT '供应商管理员',
`settlement_bank_account_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '结算银行开户名',
`settlement_bank_account_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '结算公司银行账号',
`settlement_bank_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '结算开户银行支行名称',
`settlement_bank_address` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '结算开户银行所在地',
PRIMARY KEY (`supplier_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 292 AVG_ROW_LENGTH = 4096 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '供应商' ROW_FORMAT = Compact;
```
- 序言
- 商城简介
- 代码规范
- model层命名规范
- 前端(管理页面)命名
- 控制器命名规范
- 入门指导
- 伪静态配置
- 数据库配置
- 系统环境
- 系统框架
- 目录结构
- 数据库操作
- 标准代码(前端)
- 提示面板
- 表单
- 插件开发
- 插件目录
- 插件开发说明
- 事件开发
- 常用事件
- 数据字典
- 系统基础表
- 微信小程序相关
- 微信公众号相关
- 配送相关表
- 商品相关表
- 店铺网站设置相关
- 门店相关表
- 会员相关表
- 订单相关表
- 营销(组合套餐)
- 营销(砍价)
- 营销(优惠券)
- 营销(限时折扣)
- 营销(满额包邮)
- 营销(互动游戏)
- 营销(团购)
- 营销(满减送)
- 营销(拼团)
- 营销(秒杀)
- 营销(专题)
- 应用(分销)
- 应用(店铺笔记)
- 应用(小票打印)
- 应用(积分兑换)