mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-19 00:22:51 +00:00
修改缓存清除
This commit is contained in:
parent
7b6c458d8e
commit
bbac300a43
@ -150,4 +150,32 @@ if (!function_exists('sysData')) {
|
|||||||
{
|
{
|
||||||
return app('sysGroupData')->getData($name);
|
return app('sysGroupData')->getData($name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('sort_list_tier')) {
|
||||||
|
/**
|
||||||
|
* 分级排序
|
||||||
|
* @param $data
|
||||||
|
* @param int $pid
|
||||||
|
* @param string $field
|
||||||
|
* @param string $pk
|
||||||
|
* @param string $html
|
||||||
|
* @param int $level
|
||||||
|
* @param bool $clear
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function sort_list_tier($data, $pid = 0, $field = 'pid', $pk = 'id', $html = '|-----', $level = 1, $clear = true)
|
||||||
|
{
|
||||||
|
static $list = [];
|
||||||
|
if ($clear) $list = [];
|
||||||
|
foreach ($data as $k => $res) {
|
||||||
|
if ($res[$field] == $pid) {
|
||||||
|
$res['html'] = str_repeat($html, $level);
|
||||||
|
$list[] = $res;
|
||||||
|
unset($data[$k]);
|
||||||
|
sort_list_tier($data, $res[$pk], $field, $pk, $html, $level + 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -85,6 +85,6 @@ class CacheService
|
|||||||
*/
|
*/
|
||||||
public static function clear()
|
public static function clear()
|
||||||
{
|
{
|
||||||
return CacheStatic::clear(self::$globalCacheName);
|
return self::handler()->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user