Commit b58a596d authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 5a1e4b36 ea812f01
......@@ -111,8 +111,59 @@ namespace Edu.Module.Customer
public object ConsultantStaticModule(string EmpIds, string StartTime, string EndTime)
{
object obj = new object();
var totalTotal = studentRepository.GetStudentClueRepository(EmpIds, StartTime, EndTime);
DateTime start = Convert.ToDateTime(StartTime);
DateTime end = Convert.ToDateTime(EndTime);
var days = (end - start).Days;
//线索列表
var studentList = studentRepository.GetStudentClueRepository(EmpIds, StartTime, EndTime);
//试听列表
var trialLessonList = visitor_ReserveRepository.GetVisitorReserveStaticRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{
QCreateByIds = EmpIds,
StartClassDate = StartTime,
EndClassDate = EndTime
});
//到访列表
var visitList = student_VisitRepository.GetStudentVisitStaticRepository(new RB_Student_Visit_Extend()
{
QCreateByIds = EmpIds,
StartDate = StartTime,
EndDate = EndTime
});
//订单列表
var orderList = orderRepository.GetOrderListRepository(new RB_Order_ViewModel()
{
QEnterIds = EmpIds,
StartTime = StartTime,
EndTime = EndTime,
});
List<object> dayList = new List<object>();
for (var i = 0; i < days; i++)
{
DateTime newDate = start.AddDays(i);
var tempStuList = studentList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
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();
dayList.Add(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,
});
}
obj = new
{
dayList
};
return obj;
}
}
}
}
\ No newline at end of file
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