Php time judgment

Source: Internet
Author: User
Php time judgment for help is now based on an activity that lasts for four weeks. 25 lottery tickets are required each week for users to draw. on average, the ceil (25/7) = 4 tickets can be drawn every day, however, the actual number of hits per day is the number of theoretical hits today + the number of remaining hits yesterday, here we need the database to automatically write the remaining number of today's data to the remaining number of yesterday's remaining number at every day.
Now, we have an activity that lasts for four weeks. we need to issue 25 lottery tickets each week for users to draw. on average, we can draw 4 ceil (25/7) coupons every day, however, the actual number of hits per day is the number of theoretical hits today + the number of remaining hits yesterday. here, the database needs to automatically write the remaining number of hits today to the remaining number of hits yesterday at each day, how should we judge this time? I want to update the number of remaining vouchers to 25 and the remaining number of last week at every Monday of every week, how should I write in php.

------ Solution --------------------
1. "Today's number of prizes = today's theoretical lottery + yesterday's remaining prizes" is completed at, rather than "writing the remaining number of today's prizes to the remaining number of yesterday's prizes"
2. although you can set scheduled tasks to meet your requirements, you may not have the permission to implement the tasks because the operating system is involved.
3. you only need to set the meter field to record the first entry every day, and complete the calculation and storage of today's rewards

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.