E-commerce website coupon related issues

Source: Internet
Author: User
E-commerce website coupon problem
Now there is a website member has a coupon function
Sign up for a coupon (valid for one year)
enough to buy something. Return coupon (valid for an unlimited period)
Holidays send coupons (the amount of time what the background staff definition)

That's what I'm doing.

Member Table name
UserID Member ID field
YHQ is the coupon field (the sum of the coupon amount stored)

The coupon has been sent to the time, the expiry time, the description is put into a table alone,
Table name is YHQ
ID Coupon ID Field
UserID Member ID field
Title Coupon
Start_time has sent time
End_time expiry time
Price Amount

But now, there's a problem with maturity.
If there is now a member registered today, send a 20 Yuan coupon, tomorrow to buy something to spend 10 yuan, and 10 yuan left
In a few days, the member did not post the incident and earned 20 Yuan coupon

A year later according to the requirements should be deducted 10 yuan, but the program does not know AH.

Ask the master to help solve

Or do you have this problem with coupons? How to solve the problem thank you.

------Solution--------------------
Are you out of date in the past 1 years or are you going to be giving it all out of date? Or the original 10 yuan expired, later also need to accumulate to a year after the time expires?

If it's in the back, I think you should just split it up. Design a table to record the coupon in a separate table is a simple solution.
------Solution--------------------
There seems to be no problem ah, in addition, from the application, each coupon can not be disassembled, only one-time use as if
------Solution--------------------
A coupon should only be used once to limit it.

For example, you go to the mall shopping there are 100 coupons, should not exist with 50 left 50 of the situation.

------Solution--------------------
1. Coupons should not have the concept of the sum, specifically to do a table to save all the coupons for users.
2. Coupons are for one-time consumption
3. Then ... No, then.
  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.