Browse Source

计划任务修改

lizhen_gitee 10 months ago
parent
commit
59f172326a
1 changed files with 7 additions and 6 deletions
  1. 7 6
      application/index/controller/Plantask.php

+ 7 - 6
application/index/controller/Plantask.php

@@ -93,14 +93,15 @@ class Plantask extends Controller
 
 
     //定时跑用户活跃,改成离线。 一分钟一次
-    public function auto_user_active(){
-        $actitime = time() - 7200;
-
-        $sql = 'update `mt_user` set is_active = 0 where is_active = 1 and id in (select user_id from mt_user_active where requesttime < '.$actitime.')';
+    public function auto_user_active()
+    {
+        $start_time = time() - (3600 * 24);
+        $end_time   = time() - (3600 * 2);
+        $sql        = "update `mt_user` set is_active = 0 where is_active = 1 and id in (select user_id from mt_user_active where requesttime between {$start_time} and {$end_time})";
         db()->query($sql);
     }
 
-    //发放代理奖励
+    //发放代理奖励。没用到
     public function issuingreward() {
         set_time_limit(0);
 
@@ -173,7 +174,7 @@ class Plantask extends Controller
 
 
 
-    //自动推荐。 一分钟一次
+    //自动推荐。 没用到
     public function auto_userRecommend()
     {
         $payMoney = config('site.recommend_pay_money');//财富值