E-commerce website coupon issue now a website member has a coupon function to register and send a coupon (valid for one year) enough to buy and return the coupon (not limited to the validity period) send coupons on holidays (defined by the background staff for specific time amount) my practice is that the member table name userid member ID field yhq is the coupon field (the sum of the coupon amount) discount e-commerce website coupons
A website member now has a coupon function.
Registration coupon (valid for one year)
Enough to buy and return coupons (unlimited validity period)
Send coupons on holidays (defined by background personnel for specific time amount)
My approach is like this.
Member table name
Userid member ID field
Yhq is the coupon field (the sum of the coupon amount)
Place the coupon's previous delivery time and expiration time in a separate table,
The table name is yhq.
Id coupon ID field
Userid member ID field
Title coupon title
Start_time was sent
End_time expiration time
Price
But now there is a problem: expiration.
If a member is registered today, he will receive a 20 yuan coupon and spend 10 yuan to buy things tomorrow.
In a few days, a member posted a post and earned a coupon of 20 yuan.
10 yuan should be deducted after one year, but the program does not know.
Could you help me solve this problem?
Or have you ever encountered this problem when making coupons. Thank you.
------ Solution --------------------
So do you expire in the past one year or all the gifts you give later expire together? Or does the original 10 yuan expire after a year?
I think you should split the design table and use a separate table to record the discount volume.
------ Solution --------------------
It seems that there is no problem. In addition, in terms of applications, each coupon cannot be used separately. it can only be used once.
------ Solution --------------------
One coupon can only be used once for restrictions.
For example, if you have 100 coupons for shopping in the mall, there should be no use of 50, and there are still 50.
------ Solution --------------------
1. there should be no sum of coupons. Instead, make a table to store all the coupons of users.
2. all coupons are consumed at one time.
3. then... No.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.