The e-commerce website I am going to make is similar to JINGdong. The following is the home page display:
Refer to JINGdong here, visit jingdong website to see the classification
Category tables: base_catalog1, base_catalog2, and base_catalog3 correspond to three levels of catalogs and are also required for background maintenance
Level 1 classification, do not need to pass parameters, directly query the level 1 classification table;
Secondary classification, it through your selected primary classification ID query secondary classification table;
Level 3 classification, it through your selected level 2 classification ID query level 3 classification table;
Case: The first level classification is displayed directly. Select the first level classification “mobile phone” and query the second level classification table with the mobile phone ID.
Select Secondary category Mobile Communications and query the tertiary category table using the Mobile communications ID
Background maintenance is similar to this:
Select tertial-level mobile phone and query the base_attr_info and base_attr_Value tables based on the MOBILE PHONE ID
Base_attr_info base_attr_value table
Enter the attribute of mobile phone platform, which is maintained by the platform (JINGdong).
It has platform attributes and platform attribute values, corresponding to the attribute class table: base_attr_info, base_attr_value
Therefore, viewing platform attributes and platform attribute values requires a level 3 category ID to view them.
Background maintenance is similar to:
To look down
Commodity information
Query the spu_info table using the tertiary classification ID
Background maintenance is similar to:
My data is randomly written, do not care about ha!
You can see the following items, which can not be queried by a table, it has a picture of the item, the price of the item in stock, the name of the item and so on.
Table spu_info, spu_image, spu_sale_attr, spu_sale_attr_value table
Check the inventory table: sku_info for commodity prices
Background maintenance is similar: prices are not maintained here
Click the product to enter the product details page
Sku_info skU name, price, default display picture… sku_info skU name, default display picture…
Sku_image stock image table with stock ID as parameter, query image path, default, image name…
Query the spu_sale_attr product sales attribute table using the inventory ID and product ID as parameters and obtain the sales attribute name
The spu_sale_attr_value product sales attribute value table is used as the commodity ID to query the sales attribute value
Display page:
Here is maintained by the business, the business sells goods, its inventory is changing, so the corresponding page is also changing.
So here’s the inventory table:
Sku_sal_attr_value Inventory sales attribute information, sku_attr_value inventory attribute information, sku_info inventory information, and sku_image inventory picture information
Why sku_SAL_attr_value Stock sale property information, Sku_attr_value stock property information, sku_image stock image information, spu_image, spu_sale_attr, Does the spu_sale_attr_value table have a lot of duplicate attributes?
Goods sold many properties, such as mobile phones have 2 gb of memory, 4 gb of memory, 6 gb of memory, 8 gb of memory, 10 g of memory, etc., but merchants selling mobile phone, its inventory goods handset can only 2 gb of memory, 4 gb of memory, 6 gb of memory, in the same way, the picture of the commodity might be a, let everybody understand this goods, but the businessman for this commodity has different models, Color and so on the sales attribute and the sales attribute value, so there may be multiple pictures. This requires two similar picture tables and sales property tables, one for goods (SPU) and one for inventory (SKU).
Background maintenance is similar to editing skUs based on product IDSCopy the code