Commit 850a0cf1 authored by 黄奎's avatar 黄奎

页面修改

parent 64ee8a40
...@@ -113,5 +113,15 @@ namespace Edu.Model.ViewModel.Customer ...@@ -113,5 +113,15 @@ namespace Edu.Model.ViewModel.Customer
/// 同行数量 /// 同行数量
/// </summary> /// </summary>
public int CustomerCount { get; set; } public int CustomerCount { get; set; }
/// <summary>
/// 开始日期
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束日期
/// </summary>
public string EndDate { get; set; }
} }
} }
...@@ -19,5 +19,15 @@ namespace Edu.Model.ViewModel.Customer ...@@ -19,5 +19,15 @@ namespace Edu.Model.ViewModel.Customer
/// 约访次数 /// 约访次数
/// </summary> /// </summary>
public int AppointmentCount { get; set; } public int AppointmentCount { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string EndDate { get; set; }
} }
} }
...@@ -25,6 +25,11 @@ namespace Edu.Model.ViewModel.Customer ...@@ -25,6 +25,11 @@ namespace Edu.Model.ViewModel.Customer
/// </summary> /// </summary>
public string ReceptionPersionTel { get; set; } public string ReceptionPersionTel { get; set; }
/// <summary>
/// 单个日期查询
/// </summary>
public string QueryDate { get; set; }
/// <summary> /// <summary>
/// 开始时间 /// 开始时间
/// </summary> /// </summary>
......
...@@ -681,27 +681,35 @@ namespace Edu.Module.User ...@@ -681,27 +681,35 @@ namespace Edu.Module.User
//今日到访 //今日到访
int todayVisit = visitList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == today)?.VisitCount ?? 0; int todayVisit = visitList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == today)?.VisitCount ?? 0;
//今日预约 //预约列表
int appointmentCount = student_AppointmentRepository.GetStudentVisitStaticRepository(new RB_Student_Appointment_Extend() var appointmentList = student_AppointmentRepository.GetStudentVisitStaticRepository(new RB_Student_Appointment_Extend()
{ {
CreateBy = createBy, CreateBy = createBy,
QueryDate = today StartDate = startDate,
})?.FirstOrDefault()?.AppointmentCount ?? 0; EndDate = today,
});
//今日预约
int appointmentCount = appointmentList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == today)?.AppointmentCount ?? 0;
//今日新增同行 //新增同行列表
var customerCount = customerRepository.GetCustomerStaticRepository(new RB_Customer_Extend() var customerList = customerRepository.GetCustomerStaticRepository(new RB_Customer_Extend()
{ {
CreateBy = createBy, CreateBy = createBy,
QDate = today StartDate = startDate,
})?.FirstOrDefault()?.CustomerCount ?? 0; EndDate = today
});
//今日新增同行
var customerCount = customerList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == today)?.CustomerCount ?? 0;
//今日试听 //试听列表
var trialLessonCount = visitor_ReserveRepository.GetVisitorReserveStaticRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend() var trialLessonList = visitor_ReserveRepository.GetVisitorReserveStaticRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{ {
CreateBy = createBy, CreateBy = createBy,
QDate = today StartClassDate = startDate,
})?.FirstOrDefault()?.TrialLessonCount ?? 0; EndClassDate=today
});
//今日试听
var trialLessonCount = trialLessonList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == today)?.TrialLessonCount ?? 0;
//未沟通人数 //未沟通人数
var notCommunicateCount = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() var notCommunicateCount = studentRepository.GetStudentListRepository(new RB_Student_ViewModel()
{ {
...@@ -715,7 +723,12 @@ namespace Edu.Module.User ...@@ -715,7 +723,12 @@ namespace Edu.Module.User
dayList.Add(new dayList.Add(new
{ {
x = Common.ConvertHelper.FormatMonthDay(newDate), x = Common.ConvertHelper.FormatMonthDay(newDate),
y = addList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == Common.ConvertHelper.FormatDate(newDate))?.ClueCount ?? 0 y = addList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == Common.ConvertHelper.FormatDate(newDate))?.ClueCount ?? 0,
AddCount = addList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == Common.ConvertHelper.FormatDate(newDate))?.ClueCount ?? 0,
VisitCount = visitList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == Common.ConvertHelper.FormatDate(newDate))?.VisitCount ?? 0,
appointmentCount = appointmentList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == Common.ConvertHelper.FormatDate(newDate))?.AppointmentCount ?? 0,
customerCount = customerList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == Common.ConvertHelper.FormatDate(newDate))?.CustomerCount ?? 0,
trialLessonCount=trialLessonList?.FirstOrDefault(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == Common.ConvertHelper.FormatDate(newDate))?.TrialLessonCount ?? 0,
}); });
} }
......
...@@ -192,7 +192,7 @@ WHERE o.OrderState in(1,2) and o.Group_Id ={group_Id} and o.CustomerId in({custo ...@@ -192,7 +192,7 @@ WHERE o.OrderState in(1,2) and o.Group_Id ={group_Id} and o.CustomerId in({custo
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.CreateBy,COUNT(1) AS CustomerCount SELECT A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y-%m-%d') AS CreateTime,COUNT(1) AS CustomerCount
FROM RB_Customer AS A FROM RB_Customer AS A
WHERE 1=1 WHERE 1=1
"); ");
...@@ -212,8 +212,17 @@ WHERE 1=1 ...@@ -212,8 +212,17 @@ WHERE 1=1
//指定日期新增同行数量 //指定日期新增同行数量
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Customer_Extend.CreateTime), query.QDate); builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Customer_Extend.CreateTime), query.QDate);
} }
if (!string.IsNullOrEmpty(query.StartDate))
{
builder.AppendFormat(" AND A.{0}='{1}' ", nameof(RB_Customer_Extend.CreateTime), query.StartDate);
}
if (!string.IsNullOrEmpty(query.EndDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Customer_Extend.CreateTime), query.EndDate);
}
} }
builder.AppendFormat(@" GROUP BY A.CreateBy "); builder.AppendFormat(@" GROUP BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') ");
builder.AppendFormat(@" ORDER BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') ");
return Get<RB_Customer_Extend>(builder.ToString()).ToList(); return Get<RB_Customer_Extend>(builder.ToString()).ToList();
} }
} }
......
...@@ -56,7 +56,7 @@ WHERE 1=1 ...@@ -56,7 +56,7 @@ WHERE 1=1
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.CreateBy,Count(1) AS AppointmentCount SELECT A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y-%m-%d') AS CreateTime,Count(1) AS AppointmentCount
FROM RB_Student_Appointment AS A INNER JOIN rb_student AS B ON A.StuId=B.StuId FROM RB_Student_Appointment AS A INNER JOIN rb_student AS B ON A.StuId=B.StuId
WHERE 1=1 WHERE 1=1
"); ");
...@@ -71,7 +71,6 @@ WHERE 1=1 ...@@ -71,7 +71,6 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.StuId), query.StuId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.StuId), query.StuId);
} }
if (query.CreateBy > 0) if (query.CreateBy > 0)
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.CreateBy), query.CreateBy); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.CreateBy), query.CreateBy);
...@@ -81,8 +80,16 @@ WHERE 1=1 ...@@ -81,8 +80,16 @@ WHERE 1=1
//指定日期的约访统计 //指定日期的约访统计
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.QueryDate)); builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.QueryDate));
} }
if (!string.IsNullOrEmpty(query.StartDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
}
if (!string.IsNullOrEmpty(query.EndDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.EndDate));
}
} }
builder.AppendFormat(" GROUP BY A.CreateBy "); builder.AppendFormat(" GROUP BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') ");
return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList(); return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList();
} }
} }
......
...@@ -264,7 +264,7 @@ WHERE 1=1 ...@@ -264,7 +264,7 @@ WHERE 1=1
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.CreateBy,COUNT(1) AS TrialLessonCount SELECT A.CreateBy,COUNT(1) AS TrialLessonCount,DATE_FORMAT(A.CreateTime,'%Y-%m-%d') AS CreateTime
FROM RB_Visitor_Reserve AS A FROM RB_Visitor_Reserve AS A
WHERE 1=1 WHERE 1=1
"); ");
...@@ -284,8 +284,17 @@ WHERE 1=1 ...@@ -284,8 +284,17 @@ WHERE 1=1
//指定日期的试听课数量 //指定日期的试听课数量
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Visitor_Reserve_Extend.CreateTime), query.QDate); builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Visitor_Reserve_Extend.CreateTime), query.QDate);
} }
if (!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Visitor_Reserve_Extend.CreateTime), query.StartClassDate);
}
if (!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Visitor_Reserve_Extend.CreateTime), query.EndClassDate);
}
} }
builder.AppendFormat(@" GROUP BY A.CreateBy "); builder.AppendFormat(@" GROUP BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') ");
builder.AppendFormat(@" ORDER BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') ");
return Get<RB_Visitor_Reserve_Extend>(builder.ToString()).ToList(); return Get<RB_Visitor_Reserve_Extend>(builder.ToString()).ToList();
} }
} }
......
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