Lunch break when you receive the PHP Chinese network 5 Netizens of a question, the original question is like this "I want to achieve a function: Users in my website registered an account, every day log on to my site, there will be an increase in points, this should be how to achieve it?" How does the idea go? ”。
I reply to the following information:
It's every landing plus points.
or increase the points by the day
If it is logged in. You just add an extra-integral SQL to the login handler.
If you are adding points by day. Like a week in a row, a special reward.
You need to add a list of points. Log the login time of all members and then calculate by time
After finishing the idea is as follows:
Create a log table
When the login verification-check the Member login log table, if there is an increase in points, if there is an increase in points, then only one additional log points field is empty, if not added to add a log with the integration record
<?php//query Log table, query conditions for the date of the day of the time stamp//judgment and processing whether the day has been logged on and not logged in the process (such as not landing add points)//Query the Log Table query conditions for continuous landing//If it is a continuous landing to increase points reward?>