/// <summary> /// 导航专题页面 /// </summary> /// <returns></returns> public IActionResult Index() { var topicView = new TopicSearchView(); topicView.HotTopics = _ArticleTopicService.GetTopicInfoList(new ArticleTopicSearchView { HotTopic = true, TopicStatus = TopicStatus.Audited, IgnoreCate = true }, 1, 4); topicView.TopicCates = _ArticleTopicService.GetTopicCateList(null, null, true); topicView.TopicCount = topicView.TopicCates.Sum(u => u.Childs.Count); var cateIds = topicView.TopicCates.Select(u => u.Code).ToList(); topicView.TopicCount = 0; topicView.TopicList = _ArticleTopicService.GetTopicInfoList(new ArticleTopicSearchView() { IgnoreCate = true, TopicStatus = TopicStatus.Audited }, 1, 8); return(View(topicView)); }
public IActionResult Index([FromServices] IArticleTopicService topicService, [FromServices] IArticleCategoryService articleCategoryService) { AddPageCrumbs("资源分类"); var cateList = articleCategoryService.GetCateList(null, null, true); //var topicService = SkyCore.GlobalProvider.CoreContextProvider.GetService<IArticleTopicService>(); ViewBag.TopicCates = topicService.GetTopicCateList(null, null); ViewBag.HotTopics = topicService.GetTopicInfoList(new ArticleTopicSearchView { HotTopic = true, TopicStatus = TopicStatus.Audited, IgnoreCate = true }, 1, 3); return(View(cateList)); }