/// <summary> /// Gets the home model. /// </summary> /// <param name="pi">The pi.</param> /// <param name="take">The take.</param> /// <returns></returns> public Dto.HomeDto GetHomeModel(int?pi, int?take) { Dto.HomeDto data = new Dto.HomeDto(); data.TopTourCitys = tourPlanService.GetTopTourPlanCity(10).ToList(); #region TopTourPlans if (data.TopTourCitys.Count() > 0) { foreach (var item in data.TopTourCitys) { data.TopTourPlans = tourPlanService.GetTourPlanListByCity(item.CityName, 3).ToPagedList(pi ?? 1, take ?? 10); break; } } else { data.TopTourPlans = tourPlanService.GetTourPlanListByCity("上海", 3).ToPagedList(pi ?? 1, take ?? 10); } #endregion return(data); }