商品类型实际上是商品属性分类表,包括规格和参数两种相关属性
1.相关表
pms_product_attribute_category
pms_product_attribute
两个表之间通过product_attribute_category_id 进行关联
pms_product_attribute_category 表主要存储的是产品分类属性
pms_product_attribute 表中type=0 表示的是规格,type=1表示的相关分类参数
CREATE TABLE `pms_product_attribute_category` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL,
`attribute_count` int(11) DEFAULT '0' COMMENT '属性数量',
`param_count` int(11) DEFAULT '0' COMMENT '参数数量',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='产品属性分类表'
CREATE TABLE `pms_product_attribute` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`product_attribute_category_id` bigint(20) DEFAULT NULL,
`name` varchar(64) DEFAULT NULL,
`select_type` int(1) DEFAULT NULL COMMENT '属性选择类型:0->唯一;1->单选;2->多选',
`input_type` int(1) DEFAULT NULL COMMENT '属性录入方式:0->手工录入;1->从列表中选取',
`input_list` varchar(255) DEFAULT NULL COMMENT '可选值列表,以逗号隔开',
`sort` int(11) DEFAULT NULL COMMENT '排序字段:最高的可以单独上传图片',
`filter_type` int(1) DEFAULT NULL COMMENT '分类筛选样式:1->普通;1->颜色',
`search_type` int(1) DEFAULT NULL COMMENT '检索类型;0->不需要进行检索;1->关键字检索;2->范围检索',
`related_status` int(1) DEFAULT NULL COMMENT '相同属性产品是否关联;0->不关联;1->关联',
`hand_add_status` int(1) DEFAULT NULL COMMENT '是否支持手动新增;0->不支持;1->支持',
`type` int(1) DEFAULT NULL COMMENT '属性的类型;0->规格;1->参数',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8 COMMENT='商品属性参数表'
2. 相关页面
1.添加商品规格属性
添加商品参数
页面和添加商品规格页面一样,只是类型不同