public IEnumerable <HouseInfo> Search(HouseCondition condition) { if (string.IsNullOrEmpty(condition.Source)) { var houseList = new List <HouseInfo>(); // 获取当前城市的房源配置 var cityConfigs = _configService.LoadSources(condition.CityName); var limitCount = condition.HouseCount / cityConfigs.Count; foreach (var config in cityConfigs) { //建荣家园数据质量比较差,默认不出 if (config.Source == ConstConfigName.CCBHouse) { continue; } condition.Source = config.Source; condition.HouseCount = limitCount; houseList.AddRange(DBSearch(condition)); } return(houseList.OrderByDescending(h => h.PubTime)); } else { return(DBSearch(condition)); } }
public IEnumerable <DBHouse> NewSearch(HouseCondition condition) { if (condition == null) { return(default(List <DBHouse>)); } if (string.IsNullOrEmpty(condition.Source) && string.IsNullOrEmpty(condition.Keyword)) { var houseList = new List <DBHouse>(); // 获取当前城市的房源配置 var cityConfigs = _configService.LoadSources(condition.City); if (cityConfigs.Count == 0) { return(houseList); } var limitCount = condition.Size / cityConfigs.Count; foreach (var config in cityConfigs) { condition.Source = config.Source; condition.Size = limitCount; houseList.AddRange(NewDBSearch(condition)); } return(houseList.OrderByDescending(h => h.PubTime)); } else { return(NewDBSearch(condition)); } }
public IEnumerable <DBHouse> NewSearch(NewHouseCondition condition) { if (string.IsNullOrEmpty(condition.Source)) { var houseList = new List <DBHouse>(); // 获取当前城市的房源配置 var cityConfigs = _configService.LoadSources(condition.City); if (cityConfigs.Count == 0) { return(houseList); } var limitCount = condition.Size / cityConfigs.Count; foreach (var config in cityConfigs) { //建荣家园数据质量比较差,默认不出 if (config.Source == SourceEnum.CCBHouse.GetSourceName()) { continue; } condition.Source = config.Source; condition.Size = limitCount; houseList.AddRange(NewDBSearch(condition)); } return(houseList.OrderByDescending(h => h.PubTime)); } else { return(NewDBSearch(condition)); } }