| 
@@ -70,6 +70,18 @@ trait RedisQuery { | 
 | 
@@ -70,6 +70,18 @@ trait RedisQuery { | 
| 
70
 | 
         return $this->getClient()->set($key,$this->serialize($val),$ttl);
 | 
70
 | 
         return $this->getClient()->set($key,$this->serialize($val),$ttl);
 | 
| 
71
 | 
     }
 | 
71
 | 
     }
 | 
| 
72
 | 
 
 | 
72
 | 
 
 | 
| 
 | 
   | 
73
 | 
+    /**
 | 
| 
 | 
   | 
74
 | 
+     * 设置 缓存过期时间
 | 
| 
 | 
   | 
75
 | 
+     * @param $key
 | 
| 
 | 
   | 
76
 | 
+     * @param int $ttl
 | 
| 
 | 
   | 
77
 | 
+     * @return bool
 | 
| 
 | 
   | 
78
 | 
+     * @author:dc
 | 
| 
 | 
   | 
79
 | 
+     * @time 2024/7/8 11:50
 | 
| 
 | 
   | 
80
 | 
+     */
 | 
| 
 | 
   | 
81
 | 
+    public function expire($key,$ttl = -1){
 | 
| 
 | 
   | 
82
 | 
+        return $this->getClient()->expire($key,$ttl);
 | 
| 
 | 
   | 
83
 | 
+    }
 | 
| 
 | 
   | 
84
 | 
+
 | 
| 
73
 | 
 
 | 
85
 | 
 
 | 
| 
74
 | 
     /**
 | 
86
 | 
     /**
 | 
| 
75
 | 
      * 如果有key返回false,没有则新增
 | 
87
 | 
      * 如果有key返回false,没有则新增
 |