Mysql order list, how to design shopping cart list, connect them to form a complete system, such as the following table structure

< H2 > question < / H2 >

want to add a shopping cart table, let users add items to the shopping cart, click settlement to generate the order, but do not know how to design and associate

< H2 > reference < / H2 >

the link I referenced
https://blog.csdn.net/wgyscsf.

customer(): cidcnamecphonecaddress
merchant():midmnamemphonemaddress
product():pidpnameppricepremainmid
order():oidodatetimeostateosummoneycid
orderitem():oiidiobuynumiosummoneypidoid

Shopping cart list: user id, goods id, goods quantity


you should think about where the shopping cart comes from and where it goes. Maybe it's a little weird to say that, so if you want to add goods to the shopping cart, where should it come from?
first of all, who the shopping cart belongs to, so you have to declare this by adding a field to record the user ID.
then, what is put in the shopping cart, you need to record the ID of the corresponding item, so this is also necessary.

if the order is finally generated

Menu