redis_name)->get($key); if($value !== false) { if(strpos($key,'TOKEN_WXA_') === 0){ $value = json_decode(json_decode($value),true); } return $value; } $val = Cache::get($key); if($val !== false) { return $val; } return $default; } catch(\Exception $e) { } return $default; } public function setCache($key, $value, $time = 86400) { $res2 = false; try { // $res2 = Cache::store($this->redis_name)->set($key, $value, $time); if($res2 == false){ $res = Cache::set($key, $value, $time); if($res !== false){ return $res; } } } catch(\Exception $e) { } return $res2; } public function delCache($key) { $info = false; // $info = Cache::store($this->redis_name)->rm($key); if(!$info){ $data = Cache::rm($key); if($data){ return $data; } } return $info; } public function updateCache($key,$value) { $info = false; // if( Cache::store($this->redis_name)->get($key)){ // $data = Cache::store($this->redis_name)->rm($key); // $info = Cache::store($this->redis_name)->set($key,$value,86400); // } if(Cache::get($key)){ $data = Cache::rm($key); $info = Cache::set($key,$value,86400); } return $info; } }