Commit 321c23c9 authored by 黄奎's avatar 黄奎

统计修改

parent 42560796
...@@ -406,8 +406,14 @@ namespace Edu.Module.Customer ...@@ -406,8 +406,14 @@ namespace Edu.Module.Customer
DateTime start = Convert.ToDateTime(StartTime); DateTime start = Convert.ToDateTime(StartTime);
DateTime end = Convert.ToDateTime(EndTime); DateTime end = Convert.ToDateTime(EndTime);
var days = (end - start).Days; var days = (end - start).Days;
var lastList = marketConsultantRepository.GetMarketConsultantListRepository(new RB_MarketConsultant_Extend()
{
StartTime = StartTime,
EndTime = EndTime,
QCreateByIds = EmpIds
});
//线索列表 //线索列表
//var studentList = studentRepository.GetStudentClueRepository(EmpIds, StartTime, EndTime); var studentList = studentRepository.GetStudentStaticRepository(EmpIds, StartTime, EndTime);
//试听列表 //试听列表
var trialLessonList = visitor_ReserveRepository.GetVisitorReserveStaticRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend() var trialLessonList = visitor_ReserveRepository.GetVisitorReserveStaticRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
...@@ -433,27 +439,85 @@ namespace Edu.Module.Customer ...@@ -433,27 +439,85 @@ namespace Edu.Module.Customer
EndTime = EndTime, EndTime = EndTime,
}); });
List<object> dayList = new List<object>(); List<object> dayList = new List<object>();
for (var i = 0; i < days; i++) for (var i = 0; i <= days; i++)
{ {
DateTime newDate = start.AddDays(i); DateTime newDate = start.AddDays(i);
//var tempStuList = studentList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList(); object tempObj = new object();
var tempTrialLessonList = trialLessonList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList(); if (Common.ConvertHelper.FormatDate(newDate) == Common.ConvertHelper.FormatDate(DateTime.Now))
var tempVisitList = visitList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList(); {
var tempStuList = studentList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
dayList.Add(new var tempTrialLessonList = trialLessonList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
var tempVisitList = visitList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
tempObj = new
{
DayStr = Common.ConvertHelper.FormatMonthDay(newDate),
//新增线索条数
ClueCount = tempStuList?.FirstOrDefault()?.ClueCount ?? 0,
//试听人数
TrialLessonCount = tempTrialLessonList?.Sum(qitem => qitem.TrialLessonCount) ?? 0,
//到访人数
VisitCount = tempVisitList?.Sum(qitem => qitem.VisitCount) ?? 0,
};
}
else
{ {
DayStr = Common.ConvertHelper.FormatMonthDay(newDate), var tempLast = lastList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.Date) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
//新增线索条数 tempObj = new
//ClueCount = tempStuList?.FirstOrDefault()?.ClueCount ?? 0, {
//试听人数 DayStr = Common.ConvertHelper.FormatMonthDay(newDate),
TrialLessonCount = tempTrialLessonList?.Sum(qitem => qitem.TrialLessonCount) ?? 0, //新增线索条数
//到访人数 ClueCount = tempLast?.Sum(qitem => qitem.ClueCount) ?? 0,
VisitCount = tempVisitList?.Sum(qitem => qitem.VisitCount) ?? 0, //试听人数
}); TrialLessonCount = tempLast?.Sum(qitem => qitem.TrialLessonCount) ?? 0,
//到访人数
VisitCount = tempLast?.Sum(qitem => qitem.VisitCount) ?? 0,
};
}
dayList.Add(tempObj);
} }
var yesDataList = lastList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.Date) == Common.ConvertHelper.FormatMonthDay(end.AddDays(-1)))?.ToList();
obj = new obj = new
{ {
dayList dayList,
YesDataObj = new
{
DayStr = Common.ConvertHelper.FormatMonthDay(end.AddDays(-1)),
ClueCount = yesDataList?.Sum(qitem => qitem.ClueCount) ?? 0,
YestodayClue = yesDataList?.Sum(qitem => qitem.YestodayClue) ?? 0,
CurWeekClue = yesDataList?.Sum(qitem => qitem.CurWeekClue) ?? 0,
LastWeekClue = yesDataList?.Sum(qitem => qitem.LastWeekClue) ?? 0,
CurMonthClue = yesDataList?.Sum(qitem => qitem.CurMonthClue) ?? 0,
LastMonthClue = yesDataList?.Sum(qitem => qitem.LastMonthClue) ?? 0,
FollowCount = yesDataList?.Sum(qitem => qitem.FollowCount) ?? 0,
YestodayFollow = yesDataList?.Sum(qitem => qitem.YestodayFollow) ?? 0,
CurWeekFollow = yesDataList?.Sum(qitem => qitem.CurWeekFollow) ?? 0,
LastWeekFollow = yesDataList?.Sum(qitem => qitem.LastWeekFollow) ?? 0,
CurMonthFollow = yesDataList?.Sum(qitem => qitem.CurMonthFollow) ?? 0,
LastMonthFollow = yesDataList?.Sum(qitem => qitem.LastMonthFollow) ?? 0,
VisitCount = yesDataList?.Sum(qitem => qitem.VisitCount) ?? 0,
YestodayVisit = yesDataList?.Sum(qitem => qitem.YestodayVisit) ?? 0,
CurWeekVisit = yesDataList?.Sum(qitem => qitem.CurWeekVisit) ?? 0,
LastWeekVisit = yesDataList?.Sum(qitem => qitem.LastWeekVisit) ?? 0,
CurMonthVisit = yesDataList?.Sum(qitem => qitem.CurMonthVisit) ?? 0,
LastMonthVisit = yesDataList?.Sum(qitem => qitem.LastMonthVisit) ?? 0,
TrialLessonCount = yesDataList?.Sum(qitem => qitem.TrialLessonCount) ?? 0,
YestodayTrialLesson = yesDataList?.Sum(qitem => qitem.YestodayTrialLesson) ?? 0,
CurWeekTrialLesson = yesDataList?.Sum(qitem => qitem.CurWeekTrialLesson) ?? 0,
LastWeekTrialLesson = yesDataList?.Sum(qitem => qitem.LastWeekTrialLesson) ?? 0,
CurMonthTrialLesson = yesDataList?.Sum(qitem => qitem.CurMonthTrialLesson) ?? 0,
LastMonthTrialLesson = yesDataList?.Sum(qitem => qitem.LastMonthTrialLesson) ?? 0,
SaleMoney = yesDataList?.Sum(qitem => qitem.SaleMoney) ?? 0,
YestodaySale = yesDataList?.Sum(qitem => qitem.YestodaySale) ?? 0,
CurWeekSale = yesDataList?.Sum(qitem => qitem.CurWeekSale) ?? 0,
LastWeekSale = yesDataList?.Sum(qitem => qitem.LastWeekSale) ?? 0,
CurMonrhSale = yesDataList?.Sum(qitem => qitem.CurMonrhSale) ?? 0,
LastMonthSale = yesDataList?.Sum(qitem => qitem.LastMonthSale) ?? 0,
}
}; };
return obj; return obj;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment