CREATE TABLE `product_brands` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '品牌ID', `name` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '品牌名称', `desc` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '品牌描述', `logo_url` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '品牌logo图片', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `update_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `update_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='品牌表';
CREATE TABLE `product_category` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类ID', `pid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '父ID', `name` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '分类名称', `desc` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '分类描述', `pic_url` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '分类图片', `path` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '分类地址{pid}-{child_id}-...', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `update_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `update_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='类别表';
CREATE TABLE `product_spu` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'SPU ID', `brand_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '品牌ID', `category_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分类ID', `name` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT 'spu名称', `desc` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT 'spu描述', `selling_point` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '卖点', `unit` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT 'spu单位', `banner_url` text COMMENT 'banner图片 多个图片逗号分隔', `main_url` text COMMENT '商品介绍主图 多个图片逗号分隔', `price_fee` int unsigned NOT NULL DEFAULT 0 COMMENT '售价,整数方式保存', `price_scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '售价,金额对应的小数位数', `market_price_fee` int unsigned NOT NULL DEFAULT 0 COMMENT '市场价,整数方式保存', `market_price_scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '市场价,金额对应的小数位数', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `update_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `update_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT AUTO_INCREMENT=666666 CHARSET=utf8mb4 COMMENT='spu表';
CREATE TABLE `product_sku` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'SKU ID', `spu_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'SPU ID', `attrs` text COMMENT '销售属性值{attr_value_id}-{attr_value_id} 多个销售属性值逗号分隔', `banner_url` text COMMENT 'banner图片 多个图片逗号分隔', `main_url` text COMMENT '商品介绍主图 多个图片逗号分隔', `price_fee` int unsigned NOT NULL DEFAULT 0 COMMENT '售价,整数方式保存', `price_scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '售价,金额对应的小数位数', `market_price_fee` int unsigned NOT NULL DEFAULT 0 COMMENT '市场价,整数方式保存', `market_price_scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '市场价,金额对应的小数位数', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `update_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `update_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT AUTO_INCREMENT=666666 CHARSET=utf8mb4 COMMENT='sku表';
CREATE TABLE `product_attr` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '销售属性ID', `name` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '销售属性名称', `desc` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '销售属性描述', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `update_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `update_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='销售属性表';
CREATE TABLE `product_attr_value` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '销售属性值ID', `attr_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '销售属性ID', `value` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '销售属性值', `desc` varchar(255) unsigned NOT NULL DEFAULT '' COMMENT '销售属性值描述', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `update_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `update_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='销售属性值';
CREATE TABLE `product_spu_sku_attr_map` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', `spu_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'SPU ID', `sku_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'SKU ID', `attr_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '销售属性ID', `attr_name` varchar(255) NOT NULL DEFAULT '0' COMMENT '销售属性名称', `attr_value_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '销售属性值ID', `attr_value_name` varchar(255) NOT NULL DEFAULT '0' COMMENT '销售属性值', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='关联关系冗余表';
CREATE TABLE `product_sku_stock` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID', `sku_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'SKU ID', `quantity` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '库存', `create_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间', `create_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建人staff_id', `update_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `update_by` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '修改人staff_id', `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态 1:enable, 0:disable, -1:deleted', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='sku库存表';
|