/// <summary> /// 获取周边门店-分页 /// </summary> /// <param name="query"></param> /// <returns></returns> public static QueryPageModel <ShopBranch> GetNearShopBranchs(ShopBranchQuery query) { var shopBranchInfos = _shopBranchService.GetNearShopBranchs(query); QueryPageModel <ShopBranch> shopBranchs = new QueryPageModel <ShopBranch> { Models = shopBranchInfos.Models.Select(e => new ShopBranch { AddressDetail = RenderAddress(e.AddressPath, e.AddressDetail, 1), ContactPhone = e.ContactPhone, Id = e.Id, ShopBranchName = e.ShopBranchName, Status = e.Status, DistanceUnit = e.Distance >= 1 ? e.Distance + "KM" : e.Distance * 1000 + "M", Distance = e.Distance, ServeRadius = e.ServeRadius.HasValue ? e.ServeRadius.Value : 0, Latitude = e.Latitude.HasValue ? e.Latitude.Value : 0, Longitude = e.Longitude.HasValue ? e.Longitude.Value : 0, DeliveFee = e.DeliveFee, DeliveTotalFee = e.DeliveTotalFee, IsAboveSelf = e.IsAboveSelf, IsStoreDelive = e.IsStoreDelive, ShopImages = HimallIO.GetRomoteImagePath(e.ShopImages, (string)null), ShopId = e.ShopId, FreeMailFee = e.FreeMailFee, IsRecommend = e.IsRecommend, RecommendSequence = e.RecommendSequence == 0 ? long.MaxValue : e.RecommendSequence }).ToList(), Total = shopBranchInfos.Total }; return(shopBranchs); }
/// <summary> /// 获取周边门店-分页 /// </summary> /// <param name="query"></param> /// <returns></returns> public static QueryPageModel <ShopBranch> GetNearShopBranchs(ShopBranchQuery query) { var shopBranchInfos = _shopBranchService.GetNearShopBranchs(query); QueryPageModel <ShopBranch> shopBranchs = new QueryPageModel <ShopBranch> { Models = shopBranchInfos.Models.Select(e => new ShopBranch { AddressDetail = RenderAddress(e.AddressPath, e.AddressDetail, 1), ContactPhone = e.ContactPhone, Id = e.Id, ShopBranchName = e.ShopBranchName, Status = e.Status, DistanceUnit = e.Distance >= 1 ? e.Distance + "KM" : e.Distance * 1000 + "M", Distance = e.Distance, Latitude = e.Latitude.HasValue ? e.Latitude.Value : 0, Longitude = e.Longitude.HasValue ? e.Longitude.Value : 0 }).ToList(), Total = shopBranchInfos.Total }; return(shopBranchs); }