Scheduled Tasks get expiring Coupons

Source: Internet
Author: User
Yes, the company needs to do a function, is to regularly remind users that coupons are about to expire, is now set in advance 3 days notice users, the table is very simple, on a table, there is coupon_id (coupon ID) user_id (user ID) end_time (coupon end time). Plan to run a script every day, but if you press End_time to filter, will result in a coupon will be reminded of the user a number of times, assuming a coupon 31st expires, the script today will run to this coupon, tomorrow or will run to this one. I don't know what we can do to solve this problem.

Reply content:

Yes, the company needs to do a function, is to regularly remind users that coupons are about to expire, is now set in advance 3 days notice users, the table is very simple, on a table, there is coupon_id (coupon ID) user_id (user ID) end_time (coupon end time). Plan to run a script every day, but if you press End_time to filter, will result in a coupon will be reminded of the user a number of times, assuming a coupon 31st expires, the script today will run to this coupon, tomorrow or will run to this one. I don't know what we can do to solve this problem.

Look at the requirements definition,

  1. Only one reminder, date difference condition =3

  2. Reminders multiple times until expiration date, <=3

The coupon end time is fixed, then the notice time is fixed, the notification is finished once the stop

Find a place to write down the ID, the next time directly ignored on the line Ah, how complex, or directly add a field, make the next tag, filter ignored on the line

  • 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.