using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Work.Business.ProductMappingBLL { public class MappingTaoBaoBLL { /// /// /// /// /// /// /// 如果是标题搜索,则放宽限制 /// public static List> FilterItems(List> prodList, int minPrice, int maxPrice = 0, bool isGetTitle = false, decimal multiple = 20M) { if (prodList == null || prodList.Count == 0) return new List>(); var result = prodList.Where(p => !string.IsNullOrEmpty(p.Item1) && p.Item2 >= minPrice && p.Item3 >= maxPrice && p.Item3 < (maxPrice * 3.5M + 3000)).ToList(); var resultx = result.Where(r => r.Item2 != r.Item3).ToList(); if (resultx.Count > 0) return resultx; if (result.Count > 0) return result; if (isGetTitle) { result = prodList.Where(p => !string.IsNullOrEmpty(p.Item1) && p.Item2 >= minPrice && p.Item3 < (maxPrice * multiple + 3000)).ToList(); } return result; } } }