public static IList <ShopMenuInfo> GetTopMenus(int clientType = 0) { ShopMenuDao shopMenuDao = new ShopMenuDao(); IList <ShopMenuInfo> list = HiCache.Get <IList <ShopMenuInfo> >($"DataCache-ShopMenuCacheKey-{0}"); if (list == null) { list = shopMenuDao.GetTopMenus(clientType); HiCache.Insert($"DataCache-ShopMenuCacheKey-{0}", list); } return(list); }
public static IList <ShopMenuInfo> GetMenus(int clientType = 0) { IList <ShopMenuInfo> list = new List <ShopMenuInfo>(); ShopMenuDao shopMenuDao = new ShopMenuDao(); IList <ShopMenuInfo> topMenus = shopMenuDao.GetTopMenus(clientType); if (topMenus == null) { return(list); } foreach (ShopMenuInfo item in topMenus) { IList <ShopMenuInfo> list2 = item.SubMenus = shopMenuDao.GetMenusByParentId(item.MenuId, clientType); list.Add(item); } return(list); }