为购物项目设计折扣或优惠表 [英] Designing a discount or offer table for shopping project

查看:51
本文介绍了为购物项目设计折扣或优惠表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释我如何为我的产品设计折扣表(在线购物项目中)。目前我有以下领域............



1 offer-id

2 product-id

3报价标题

4报价 - 说明

5 discount_value

6日期补充

7开始日期

8到期日

9状态



假设我想给特定类别产品的折扣或购物金额大于特定金额时,如何将其存储在我的表格中。请帮助........

Can somebody explain how can i design a discount table for my products ( in an online shopping project ). Currently i have following fields............

1 offer-id
2 product-id
3 offer-title
4 offer-description
5 discount_value
6 date-added
7 start-date
8 expiry-date
9 status

Suppose i want to give discount on a particular category of products or if shopping amount is greater than a specific amount, how can i store it in my table. Please help........

推荐答案

您需要在数据库中包含类别。然后,您可以添加类别ID并允许产品ID为null或类别ID为null,因此它支持两者。或者,我会再次采用不同的方式。我的表中有一个包含字段1和3-9的表。然后,我将有一个表将商品ID加入产品ID,另一个表将商品ID加入到类别ID中。这假设折扣是%折扣,如果它是一个硬值,那么无论如何你都需要每个产品一个条目。
You would need to have categories in your database. Then you could add a category id and allow for the product id to be null or the category id to be null, so it supports both. Or, I would do it differently again. I'd have a table that has fields 1 and 3-9 in your list. Then I'd have a table joining offer id to product id and another table to join offer id to category id. This assumes the discount is a % off, if it's a hard value, then you need an entry per product no matter what, obviously.


这篇关于为购物项目设计折扣或优惠表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆