眼眸繁星
您需要研究EAV实体属性值的概念。你的桌子可能是:categories (id, title, parent_id, status) ; here parent_id is to handle child categoriesproducts (id, title, description, price, status, quantity)attributes (id, title, status) ; attribute can have colors, sizesattributevalues (id, attribute_id, value, status) ; it contains colors's attribute_id and values can be green, red, yellow etcattributes_products (id, product_id, attribute_id, attributevalue_id, price, sign) ; it will be attaching attribute title with options to a product also how much price add or minus in case of products attributes如有疑问,请多问