dever 7 лет назад
Родитель
Сommit
71c6389c52
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      src/Auth.php

+ 6 - 1
src/Auth.php

@@ -22,6 +22,8 @@ class Auth
      */
     private $save;
 
+    private $top;
+
     /**
      * __construct
      *
@@ -465,6 +467,7 @@ class Auth
             $data = $this->data();
 
             $key = str_replace('/', '-', $key);
+            $this->top = $info;
             $this->save->add($this->name . '_topgetv1_' . $key . '_a' . $data['id'], $info, 3600 * 24 * 365);
         }
     }
@@ -482,13 +485,15 @@ class Auth
 
         $key = str_replace('/', '-', $key);
         $data = $this->save->get($this->name . '_topgetv1_' . $key . '_a' . $data['id']);
-
+        //print_r($data);die;
         # 当数据不存在时,先从数据库里取出一个最新的
         if (!$data && $state == true) {
             $info = Dever::db('manage/top')->key(array('where_key' => $key));
             if ($info) {
                 $data = Dever::db('manage/top')->getOne(array('where_top_id' => $info['id']));
             }
+        } elseif (!$data && $this->top) {
+            $data = $this->top;
         }
 
         return $data;