/// <summary> /// 显示“我的收藏”列表(文章和新闻) /// </summary> /// <returns></returns> public ActionResult MyFav() { var list = AccountMgr.GetUserCollections(CurrentUser.id).Where(t => t.content_type == ContentType.文章 || t.content_type == ContentType.新闻).OrderByDescending(t => t.collect_dt).ToList(); ViewBag.ArticleList = AccountMgr.GetUserArticleCollections(CurrentUser.id); ViewBag.NewsList = AccountMgr.GetUserNewsCollections(CurrentUser.id); return(View(list)); }
/// <summary> /// 获取“我的”页面 /// </summary> /// <returns></returns> public ActionResult Index() { var userid = CurrentUser == null ? 0 : CurrentUser.id; ViewBag.Messages = AccountMgr.GetUserMessages(userid); ViewBag.UserCollections = AccountMgr.GetUserCollections(userid); return(View(CurrentUser)); }