包含多个优惠和产品的优惠系统
我正在开发一个报价系统,我遇到了以下问题:
如果我有一个报价,购买“产品 A”和“产品 B”时我支付的费用减少了 10%,我可以注册为新报价,例如可乐,把价格打折10%,可以,但问题是,如果用户选择产品A,产品BI想将其转化为折扣,即选择产生折扣的产品,用户就拿走了折扣。
我的解决方案是: 我可以制作一个包含产品的表格,并将产品类型设置为正常和促销,如果产品类型是促销,将有一个与产品关联的表格(在本例中为产品 A 和产品 B),但是如果我有10个优惠,我需要验证每个产品以确保它参与促销,我认为太慢了。
抱歉我的英语,如果你不明白我的意思,请发表评论。谢谢!
I am developing a system of offers and I came up with the following problem:
If I have an offer that buying the "product A" and "Product B" I paid 10% less, I can register as a new offer such a product like Coke, putting the price discounting 10%, ok, but the problem is, if the user select the product A and product B I want to convert it to a discount, ie, selecting the products that generate the discount, the user takes the discount.
My solution is:
I could make a table with the products and set the type of product as normal and promotion, if the type of product is promotion, will have a table associated with the products (in this case the product A and product B), but If I have 10 offers, I need to verify each product to ensure it participates in the promotion, I think soo slow.
Sorry my English, if you don't understand me, leave a comment. thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正常设置产品表。然后设置一个特别优惠表和一个针对每个优惠中包含的产品的表。
表
product_idproduct_name
表
优惠表
offer_idpercent_off
产品
Products_In_Offer
offer_idproduct_id
:
Setup the products table as normal. Then set up a special offers table and a table for the products included in each offer.
Products Table
product_id
product_name
Offers Table:
offer_id
percent_off
Products_In_Offer Table
offer_id
product_id