tzbl
本人想要做一個(gè)網(wǎng)上書店系統(tǒng),所有功能盡量用開源框架,希望可以得到大家的幫助和支持,我的開發(fā)經(jīng)歷也會紀(jì)錄在這里的。 |
1.? 數(shù)據(jù)庫的業(yè)務(wù)實(shí)體
a.?????? account 用戶
b.?????? admin 用戶
c.?????? 商品分類 category
d.?????? 具體的商品 item
e.?????? 購物車 shoppingCart
f.??????? 訂單 order
g.?????? 購物車中的商品 shoppingCartItem
h.?????? 訂單中的商品 orderItem
2.? 數(shù)據(jù)庫表設(shè)計(jì)
數(shù)據(jù)表:
a.?????? adimin 表
b.?????? account 表 ( 主鍵: account_id)
c.?????? 商品分類表 category( 主鍵: category_id)
d.?????? 商品表 item( 主鍵: item_id, 主要鍵值 item_category_id, total_numbers, left_numbers)
e.?????? 訂單 order( 主鍵: order_id, 主要鍵值 order_account_id , status)
f.??????? 訂單中的商品表 orderItem( 主鍵: orderItem_id, 主要鍵值: orderItem_order_id , orderItem_item_id, bookNumbers)
數(shù)據(jù)表解釋:
藍(lán)色的都為外鍵。兩個(gè)下折線中間那個(gè)為外鍵相關(guān)的表。
至于 item 中的圖書總數(shù)量和剩余數(shù)量,以及訂單的圖書狀態(tài),總覺得這樣設(shè)計(jì)不是很好,不知道大家是怎么設(shè)計(jì)的?