包含多个优惠和产品的优惠系统

发布于 2025-01-07 12:55:54 字数 312 浏览 4 评论 0原文

我正在开发一个报价系统,我遇到了以下问题:

如果我有一个报价,购买“产品 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凌乱心跳 2025-01-14 12:55:54

正常设置产品表。然后设置一个特别优惠表和一个针对每个优惠中包含的产品的表。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文