/// <summary> /// 获取品牌热销商品 /// </summary> /// <param name="queryInfo"></param> /// <returns></returns> private static List <ProductItemInfo> GetBrandHotProductList(BrandZoneQueryVM queryInfo) { List <ProductItemInfo> allHotProducts = GetAllHotProductList(); if (allHotProducts != null && allHotProducts.Count > 0) { List <ProductItemInfo> hotProductList = allHotProducts.FindAll(x => x.BrandSysNo == queryInfo.BrandSysNo); return(hotProductList); } return(null); }
/// <summary> /// 获取品牌信息 /// </summary> /// <param name="queryInfo"></param> /// <returns></returns> private static BrandInfoExt GetBrandInfo(BrandZoneQueryVM queryInfo) { List <BrandInfoExt> allBrands = ProductFacade.GetAllBrands(); if (allBrands != null && allBrands.Count > 0) { BrandInfoExt brandInfo = allBrands.Find(x => x.SysNo == queryInfo.BrandSysNo); return(brandInfo); } return(null); }
/// <summary> /// 取得品牌专区数据 /// </summary> /// <param name="queryInfo"></param> /// <returns></returns> public static BrandZoneVM QueryBrandZoneVM(BrandZoneQueryVM queryInfo) { BrandZoneVM result = new BrandZoneVM() { BrandSysNo = queryInfo.BrandSysNo }; result.ProductSearchResult = GetProductSearchResult(queryInfo); result.BannerList = RecommendFacade.GetBannerInfoByPositionID(queryInfo.BrandSysNo, PageType.BrandZone, BannerPosition.BrandZone_TopRight); result.HotProductList = GetBrandHotProductList(queryInfo); result.BrandInfo = GetBrandInfo(queryInfo); return(result); }
/// <summary> /// 查询品牌下商品 /// </summary> /// <param name="queryInfo"></param> /// <returns></returns> private static ProductSearchResult GetProductSearchResult(BrandZoneQueryVM queryInfo) { ProductSearchCondition condition = new ProductSearchCondition() { IsGroupQuery = true, KeyWord = queryInfo.Keyword }; //分页 if (queryInfo.PageNumber <= 1) { queryInfo.PageNumber = 1; } condition.PagingInfo = new Utility.DataAccess.SearchEngine.PagingInfo() { PageNumber = queryInfo.PageNumber, PageSize = 15 }; //排序 if (queryInfo.SortMode <= 0) { queryInfo.SortMode = 10; } SortEntity sortEntity = SortKeyValueMappingConfig.SortItemList.Find(f => f.Key == queryInfo.SortMode); if (sortEntity == null) { sortEntity = SortKeyValueMappingConfig.SortItemList[0]; } condition.SortItems = new List <SortItem>() { sortEntity.Item }; condition.NValueList = new List <string>(); condition.Filters = new List <FilterBase>(); if (queryInfo.BrandSysNo > 0) { condition.Filters.Add(new FieldFilter("p_brandid_n", (ConstValue.SINGLE_BRAND_STORE_DMSID_SEED + queryInfo.BrandSysNo).ToString())); } if (!String.IsNullOrWhiteSpace(queryInfo.SubCategoryEnID)) { condition.NValueList.Add(queryInfo.SubCategoryEnID); } var result = ProductSearchFacade.GetProductSearchResultBySolr(condition); return(result); }