Browse Source

会员升级

Kirin 7 months ago
parent
commit
8819afdded
1 changed files with 4 additions and 6 deletions
  1. 4 6
      app/controller/api/v1/PublicController.php

+ 4 - 6
app/controller/api/v1/PublicController.php

@@ -72,11 +72,9 @@ class PublicController extends BaseController
 
     public function test()
     {
-        CacheService::set('max_id', 0);
-        CacheService::set('last_time', 0);
-        $max_id = CacheService::get('max_id', 0);
+        $max_id = CacheService::redisHandler()::get('max_id', 0);
         $list = UserIntegral::where('type', 0)->where('status', 0)->order('id asc')->where('id', '>', $max_id)->limit(300)->select();
-        $last_time = CacheService::get('last_time', 0);
+        $last_time = CacheService::redisHandler()::get('last_time', 0);
         $service = app()->make(AwardIntegralServices::class);
         echo date('Y-m-d', $list[0]['add_time']) . '<br>';
         foreach ($list as $v) {
@@ -92,8 +90,8 @@ class PublicController extends BaseController
             $last_time = $v['add_time'];
             $max_id = $v['id'];
         }
-        CacheService::set('max_id', $max_id);
-        CacheService::set('last_time', $last_time);
+        CacheService::redisHandler()::set('max_id', $max_id);
+        CacheService::redisHandler()::set('last_time', $last_time);
 
         if (count($list) < 300 && strtotime(date('Y-m-d', $last_time)) < strtotime(date('Y-m-d'))) {
             echo date('Y-m-d') . '<br>';