Categories
Commodity classification table
create table pms_product_category( id bigint not null auto_increment, parent_id bigint comment'The number of the parent category: 0 means the first level category', name varchar(64) comment'name', level int(1) comment'Classification level: 0->1 Level; 1->Level 2', product_count int comment'Product quantity', product_unit varchar(64) comment'Product unit', nav_status int(1) comment'Whether it is displayed in the navigation bar: 0->not displayed; 1-> Display', show_status int(1) comment'Display status: 0->not display; 1->display', sort int comment'sort', icon varchar(255) comment'icon', keywords varchar(255) comment'key Word', description text comment'description', primary key (id));
Management side display
Product category list
Add product category
Mobile display
Brand management
Commodity brand list
create table pms_brand( id bigint not null auto_increment, name varchar(64) comment'name', first_letter varchar(8) comment'first letter', sort int comment'sort', factory_status int(1) comment'whether it is a brand manufacturer :0->No; 1->Yes', show_status int(1) comment'whether to display', product_count int comment'number of products', product_comment_count int comment'number of product reviews', logo varchar(255) comment'brand logo' , big_pic varchar(255) comment'special area big picture', brand_story text comment'brand story', primary key (id));
Management side display
Brand list
Add brand
Mobile display
Product Types
The commodity type is the commodity attribute, which mainly refers to the specifications and parameters of the commodity. The specification is used for selection when the user purchases the commodity, and the parameter is used for marking the commodity attribute and filtering during search.
Related table structure
Commodity attribute classification table
create table pms_product_attribute_category( id bigint not null auto_increment, name varchar(64) comment'name', attribute_count int comment'number of attributes', param_count int comment'number of parameters', primary key (id));
Product attribute table
The type field is used to control whether it is a specification or a parameter
create table pms_product_attribute( id bigint not null auto_increment, product_attribute_category_id bigint comment '商品属性分类id', name varchar(64) comment '名称', select_type int(1) comment '属性选择类型:0->唯一;1->单选;2->多选;对应属性和参数意义不同;', input_type int(1) comment '属性录入方式:0->手工录入;1->从列表中选取', input_list varchar(255) comment '可选值列表,以逗号隔开', sort int comment '排序字段:最高的可以单独上传图片', filter_type int(1) comment '分类筛选样式:1->普通;1->颜色', search_type int(1) comment '检索类型;0->不需要进行检索;1->关键字检索;2->范围检索', related_status int(1) comment '相同属性产品是否关联;0->不关联;1->关联', hand_add_status int(1) comment '是否支持手动新增;0->不支持;1->支持', type int(1) comment '属性的类型;0->规格;1->参数', primary key (id));
Product attribute value table
If the corresponding parameter is a specification and the specification supports manual addition, then the table is used to store the manually added value; if the corresponding commodity attribute is a parameter, then the table is used to store the value of the parameter.
create table pms_product_attribute_value( id bigint not null auto_increment, product_id bigint comment'product id', product_attribute_id bigint comment'product attribute id', value varchar(64) comment'Manually add specifications or parameter values, parameter single value, multiple specifications When separated by a comma', primary key (id));
The relationship table between commodity classification and attributes
Used to generate filter attributes when searching after selecting a category.
create table pms_product_category_attribute_relation( id bigint not null auto_increment, product_category_id bigint comment '商品分类id', product_attribute_id bigint comment '商品属性id', primary key (id));
Management side display
Product attribute classification list
Add product attribute classification
Product specification list
Commodity parameter list
Add product attributes
When adding a product, select the product attribute category, the attribute of the category will be displayed and used to generate sku
When adding a product, select the product attribute category, the parameters of that category will be displayed for input
Mobile display
Choose product specifications
View product parameters
Used to select the sorting filter when searching for products