|
@@ -165,15 +165,15 @@ class SiteCache
|
|
|
* @param int $seconds 缓存时间(秒)
|
|
|
* @return array
|
|
|
*/
|
|
|
- public static function getMenu(string $domain, int $dist_id=0,int $seconds = 300): array
|
|
|
+ public static function getMenu(string $domain,int $menu_location=0, int $dist_id=0,int $seconds = 300): array
|
|
|
{
|
|
|
// 检查 URL 是否需要清除菜单缓存
|
|
|
self::checkAndClearCache($domain, 'menu'); // 检查是否需要清缓存
|
|
|
|
|
|
// 使用缓存存储和获取多级菜单
|
|
|
- return Cache::tags([$domain, 'menu'])->remember('menu', $seconds, function () use ($dist_id) {
|
|
|
+ return Cache::tags([$domain, "menu_{$menu_location}"])->remember('menu', $seconds, function () use ($menu_location,$dist_id) {
|
|
|
$menuService = new MenuService();
|
|
|
- return $menuService->getMultiLevelMenu($dist_id);
|
|
|
+ return $menuService->getMultiLevelMenu($menu_location,$dist_id);
|
|
|
});
|
|
|
}
|
|
|
|