Product promotion Activities
Direct discount (to a discount rate, item by discount)
Fixed amount (a fixed amount directly to a product)
Price Reduction (Direct item reduction)
Offer gifts (How many items a single item buys, send a gift)
Buy a gift (buy m send n for a single item)
Group Purchase (package, multi-item combination one set price)
Snapping (single item designated total buy m pieces, each user has a separate limited purchase of 1 pieces)
This above the promotions, 表结构如何设计最佳 . A person is completed in 1.5 months. Can finish? Visual inspection is not available. Met XX Manager!
Reply content:
Product promotion Activities
Direct discount (to a discount rate, item by discount)
Fixed amount (a fixed amount directly to a product)
Price Reduction (Direct item reduction)
Offer gifts (How many items a single item buys, send a gift)
Buy a gift (buy m send n for a single item)
Group Purchase (package, multi-item combination one set price)
Snapping (single item designated total buy m pieces, each user has a separate limited purchase of 1 pieces)
This above the promotions, 表结构如何设计最佳 . A person is completed in 1.5 months. Can finish? Visual inspection is not available. Met XX Manager!
See your visit volume, if the traffic is not large, do not consider design, should also be able to do
But if there's a lot of concurrency, it's just hey Hey,
That's how I think.
A commodity or commodity sub-table.
Direct discount (to a discount rate, item by discount)
Fixed amount (a fixed amount directly to a product)
Price Reduction (Direct item reduction)
There's a stock list of these and commodities.
Offer gifts (How many items a single item buys, send a gift)
Buy a gift (buy m send n for a single item)
Order-related storage order Form
Design independent modules related to multiple tables
Group Purchase (package, multi-item combination one set price) Buy module
Snapping (single item designated total buy m pieces, each user has a separate limited purchase of 1 pieces) snapping module
Add the properties related to scheduled task maintenance time.
Look at things like design patterns, such as encapsulating the method of generating prices. Is that different activities return the price is not the same, it is easy to say, to realize the need to understand the design pattern
The commodity table is associated with a promotion rule field, associated with the following ID
There are a number of rules in the promotion rules that can be directly added to the list, including all the rules you say.
ID, discount type, direct discount, fixed amount. Buy m, gift N (this becomes two fields) ..... These
直接折扣(给一个折扣率,商品按折扣)固定金额(直接给某商品一个固定金额)减价(直接单品减价)优惠送礼品(某单品购满多少件,送某礼品)买赠(某单品买M送N)团购(套餐,多个单品组合一个套餐价)抢购(单品指定总抢购M件,每个用户有单独限购1件)
Also a user purchase schedule ()
UserID, promo rule ID, order number .....
The first two are federated primary keys, so that different products add different rules will not affect the purchase limit
You can also add restrictions to orders
Write a calculation method class
Based on the rule ID calculation (convenient for unified modification), such as limited purchase rules, you can further query user purchase schedule limit
To tell the truth, you this demand so clear, directly on the dry Bai, 1.5 months??? No overtime for a week, and this includes testing
What I said above can deal with the same direct discount but different items have different discounts, just add a new rule on the line
If you want to make a promotion on a certain category, you can do the logical processing in the calculation.