public ActionResult Index() { ArticleFilter af = new ArticleFilter(); af.Status = Consts.ArticleStatus_Published; var pager = PageReq <ArticleFilter> .Create(af, 1, 10); var article = jlService.ArticlePage(pager); return(View(article)); }
// GET: backend/Article public ActionResult Index(ArticleSearchModel model, int page = 1) { ArticleFilter filter = new ArticleFilter(); filter.Title = model.Title; filter.Status = Consts.ArticleStatus_All; var pager = PageReq <ArticleFilter> .Create(filter, page); pager.OrderBy = "order by addtime"; var data = jlService.ArticlePage(pager); ViewBag.articleQuery = filter; ViewBag.ReturnUrl = Request.Url.PathAndQuery; return(View(data)); }
public ActionResult Index() { // 新品推荐 var recommendProducts = jlService.GetProductsRecommends(); ViewBag.RecommendProducts = recommendProducts; // 产品中心 ProductFilter filter = new ProductFilter(); filter.Status = 0; var productCenter = jlService.ProductPage(PageReq <ProductFilter> .Create(filter, pageSize: 6)); ViewBag.ProductCenter = productCenter.Data; // 套装系列 var pager = PageReq.Create(pageSize: 5); jlService.ProductCategoryPage(pager); // members MemberFilter mf = new MemberFilter(); var members = jlService.MemberPage(PageReq <MemberFilter> .Create(mf, pageSize: 5)); ViewBag.Members = members.Data; // 资讯中心 ArticleFilter af = new ArticleFilter(); af.Status = Consts.ArticleStatus_Published; var articlePager = PageReq <ArticleFilter> .Create(af, pageSize : 8); articlePager.OrderBy = " order by addtime desc "; var articles = jlService.ArticlePage(articlePager); ViewBag.Articles = articles.Data; return(View()); }