Home > Backend Development > PHP Tutorial > An example explains the development idea of ​​Thinkphp to continuously sign in to obtain points.

An example explains the development idea of ​​Thinkphp to continuously sign in to obtain points.

PHP中文网
Release: 2023-03-15 17:10:01
Original
2851 people have browsed it

Thinkphp3.2 developed the function of continuously signing in to obtain points. The current points obtaining rules are: 3 points for signing in every day, and 6 points for signing in for more than 3 consecutive days. After signing in, you can view the check-in record of the current month on the calendar

Sign-in table: where num represents the number of consecutive sign-ins. If there is no sign-in for a day, then num starts from 1

An example explains the development idea of ​​Thinkphp to continuously sign in to obtain points.

CREATE TABLE IF NOT EXISTS `mall_sign` ( 
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 
  `uid` int(11) NOT NULL, 
  `points` int(6) NOT NULL COMMENT '签到积分', 
  `num` int(8) NOT NULL DEFAULT '0' COMMENT '连续签到次数', 
  `addtime` int(10) NOT NULL COMMENT '签到时间', 
  PRIMARY KEY (`id`) 
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ; 
 
-- 
-- 转存表中的数据 `mall_sign` 
-- 
 
INSERT INTO `mall_sign` (`id`, `uid`, `points`, `num`, `addtime`) VALUES 
(1, 1, 6, 1, 1502985600), 
(2, 1, 6, 2, 1503072000), 
(3, 1, 6, 3, 1503158400);
Copy after login


The above is the detailed content of An example explains the development idea of ​​Thinkphp to continuously sign in to obtain points.. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template