zqwang 2 лет назад
Родитель
Сommit
2002c8a03a
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      app/Modules/User/Services/UserService.php

+ 4 - 4
app/Modules/User/Services/UserService.php

@@ -57,13 +57,13 @@ class UserService
 
 
     public static function qappAddDesktop(int $uid, int $status)
     public static function qappAddDesktop(int $uid, int $status)
     {
     {
-        $key = "last_add_desktop_status_".$uid;
-        $last_status =  Cache::get($key, -1);
+        $key = "last_add_desktop_status";
+        $last_status = Redis::hget($key,$uid);
 
 
-        if ($last_status > -1 && $last_status == $status){
+        if ($last_status != NULL  && $last_status == $status){
             return false;
             return false;
         }
         }
-        Cache::forever($key, $status);
+        Redis::hset($key,$uid,$status);
 
 
         // myLog('incrAddDeskTop')->info('qappAddDesktop', compact('uid', 'status'));
         // myLog('incrAddDeskTop')->info('qappAddDesktop', compact('uid', 'status'));
         $log = QappUserAddDestop::where('uid', $uid)->orderBy('id', 'desc')->first();
         $log = QappUserAddDestop::where('uid', $uid)->orderBy('id', 'desc')->first();