Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the continuous check-in function of ThinkPHP

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "ThinkPHP how to achieve continuous check-in function", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "ThinkPHP how to achieve continuous check-in function" bar!

Table structure

/ * * implementation of continuous check-in * /

Public function signList () {

/ * * find out if this user exists first * /

$m_id = $_ GET ['mSecretid']

$sign = D ('Sign')-> where (array ("m_id" = > $m_id)-> limit (0)-> find ()

/ * * if so, judge the time difference, and then deal with the number of check-ins * /

If ($sign) {

/ * yesterday's timestamp time range * /

$t = time ()

$last_start_time = mktime ("m", $t), date ("d", $t)-1 magic date ("Y", $t))

$last_end_time = mktime (23 and 59 (m), $t), date ("d", $t)-1 ("Y", $t))

/ * Today's timestamp time range * /

/ / $now_start_time = mktime (0Magne0Gram0date ("m", $t), date ("d", $t), date ("Y", $t))

/ / $now_end_time = mktime (23 date 59, $t, date ("d", $t), date ("Y", $t)

/ * * determine whether the last check-in time is within yesterday's time range * /

If ($last_start_time$m_id)-> save ($da)

} else {

/ * * return the checked-in operation * /

$da ['time'] = time ()

$da ['count'] = 0

D ('Sign')-> where (array ("m_id" = > $m_id)-> save ($da)

}

} else {

$data ['mroomid'] = $m_id

$data ['time'] = time ()

$data ['sign'] = 1

$res = D ("Sign")-> add ($data)

If ($res) {

/ * * return if successful, or deal with some programs, such as adding points * /

}

}}

Thank you for reading, the above is the content of "how to achieve continuous check-in function in ThinkPHP". After the study of this article, I believe you have a deeper understanding of how to achieve continuous check-in function in ThinkPHP, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report