Home  >  Article  >  Backend Development  >  php development thinking to realize member login and bonus points

php development thinking to realize member login and bonus points

PHP中文网
PHP中文网Original
2017-07-30 18:01:051563browse

During the lunch break, I received a question from netizens in Group 5 of the php Chinese website. The original question was like this: "I want to implement a function like this: after users register an account on my website, they will log in to my website every day. There is an increase in points, how should this be achieved? What is the idea? "

The information I replied is as follows:

Do you want to add points every time you log in?

Or do you add points on a daily basis

If you log in. You just add a sql to add points to the login handler

If you want to add points on a daily basis. For example, if you log in for a week in a row and you get special rewards

, you need to add a points table. Record the login time of all members and then calculate it by time

The organized ideas are as follows:

  1. Create a login log table

  2. Judged during login verification-query the member login log table->If there are points added on that day->If there are points added, then only one log is added. The points field is empty->If not To increase points, add a log with points records

<?php

//查询登陆日志表,查询条件为当日的时间戳
//判断并处理 当日是否已经登陆过 以及未登陆过 处理方式 (如未登陆 增加积分 )
//再次查询登陆日志表 查询条件为是否连续登陆
//如果是连续登陆增加积分奖励
?>

php development thinking to realize member login and bonus points

php development thinking to realize member login and bonus points

The above is the detailed content of php development thinking to realize member login and bonus points. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn