|
...
|
...
|
@@ -72,9 +72,13 @@ class Common |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function get_user_cache($table,$id,$type = 'B'){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
$lists = Cache::store('file')->get($key);
|
|
|
|
return $lists;
|
|
|
|
$data = [];
|
|
|
|
$cache = config('cache.user_is_cache');
|
|
|
|
if(isset($cache) && ($cache['is_cache'] == true)){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
$data = Cache::store('file')->get($key);
|
|
|
|
}
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -84,8 +88,11 @@ class Common |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function set_user_cache($data = [],$table,$id,$type = 'B'){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
Cache::store('file')->set($key,$data,3600);
|
|
|
|
$cache = config('cache.user_is_cache');
|
|
|
|
if(isset($cache) && ($cache['is_cache'] == true)){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
Cache::store('file')->set($key,$data,3600);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -96,11 +103,15 @@ class Common |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public static function del_user_cache($table,$id = '',$type = 'B'){
|
|
|
|
if (!empty($id)){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
}else{
|
|
|
|
$key = 'cache_'.$table.'_*';
|
|
|
|
$cache = config('cache.user_is_cache');
|
|
|
|
if(isset($cache) && ($cache['is_cache'] == true)){
|
|
|
|
if (!empty($id)){
|
|
|
|
$key = 'cache_'.$table.'_'.$id.'_type';
|
|
|
|
}else{
|
|
|
|
$key = 'cache_'.$table.'_*';
|
|
|
|
}
|
|
|
|
Cache::store('file')->pull($key);
|
|
|
|
}
|
|
|
|
return Cache::store('file')->pull($key);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|