Home >Backend Development >PHP Tutorial >An example explains the development idea of Thinkphp to continuously sign in to obtain points.
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
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);
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!