Commit 2c282165 authored by 黄奎's avatar 黄奎

页面修改

parent 982191a2
...@@ -103,5 +103,15 @@ namespace Edu.Model.ViewModel.Customer ...@@ -103,5 +103,15 @@ namespace Edu.Model.ViewModel.Customer
/// 查询创建人 /// 查询创建人
/// </summary> /// </summary>
public int QCreateBy { get; set; } public int QCreateBy { get; set; }
/// <summary>
/// 查询日期
/// </summary>
public string QDate { get; set; }
/// <summary>
/// 同行数量
/// </summary>
public int CustomerCount { get; set; }
} }
} }
...@@ -155,5 +155,10 @@ namespace Edu.Model.ViewModel.Reserve ...@@ -155,5 +155,10 @@ namespace Edu.Model.ViewModel.Reserve
/// 试听次数 /// 试听次数
/// </summary> /// </summary>
public int TrialLessonCount { get; set; } public int TrialLessonCount { get; set; }
/// <summary>
/// 查询日期
/// </summary>
public string QDate { get; set; }
} }
} }
...@@ -104,6 +104,7 @@ namespace Edu.Module.User ...@@ -104,6 +104,7 @@ namespace Edu.Module.User
/// </summary> /// </summary>
private readonly RB_Student_AppointmentRepository student_AppointmentRepository = new RB_Student_AppointmentRepository(); private readonly RB_Student_AppointmentRepository student_AppointmentRepository = new RB_Student_AppointmentRepository();
/// <summary> /// <summary>
/// 获取学生列表 /// 获取学生列表
/// </summary> /// </summary>
...@@ -660,20 +661,45 @@ namespace Edu.Module.User ...@@ -660,20 +661,45 @@ namespace Edu.Module.User
{ {
var today = Common.ConvertHelper.FormatDate(DateTime.Now); var today = Common.ConvertHelper.FormatDate(DateTime.Now);
//今日新增名单 //今日新增名单
int todayAdd= studentRepository.GetStudentStaticRepository(createBy.ToString(), today, today)?.FirstOrDefault()?.ClueCount ?? 0; int todayAdd = studentRepository.GetStudentStaticRepository(createBy.ToString(), today, today)?.FirstOrDefault()?.ClueCount ?? 0;
//今日到访 //今日到访
int todayVisit = student_VisitRepository.GetStudentVisitStaticRepository(new RB_Student_Visit_Extend() { CreateBy = createBy, QueryDate = today })?.Count() ?? 0; int todayVisit = student_VisitRepository.GetStudentVisitStaticRepository(new RB_Student_Visit_Extend() { CreateBy = createBy, QueryDate = today })?.Count() ?? 0;
//今日预约 //今日预约
int AppointmentCount = student_AppointmentRepository.GetStudentVisitStaticRepository(new RB_Student_Appointment_Extend() int appointmentCount = student_AppointmentRepository.GetStudentVisitStaticRepository(new RB_Student_Appointment_Extend()
{ {
CreateBy = createBy, CreateBy = createBy,
QueryDate = today QueryDate = today
})?.FirstOrDefault()?.AppointmentCount ?? 0; })?.FirstOrDefault()?.AppointmentCount ?? 0;
//今日新增同行
var customerCount = customerRepository.GetCustomerStaticRepository(new RB_Customer_Extend()
{
CreateBy = createBy,
QDate = today
})?.FirstOrDefault()?.CustomerCount ?? 0;
//今日试听
var trialLessonCount = visitor_ReserveRepository.GetVisitorReserveStaticRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{
CreateBy = createBy,
QDate = today
})?.FirstOrDefault()?.TrialLessonCount ?? 0;
//未沟通人数
var notCommunicateCount = studentRepository.GetStudentListRepository(new RB_Student_ViewModel()
{
CreateBy = createBy,
StuStage = 1
})?.Count();
object obj = new object obj = new
{ {
todayAdd, todayAdd,
todayVisit, todayVisit,
AppointmentCount appointmentCount,
customerCount,
trialLessonCount,
notCommunicateCount
}; };
return obj; return obj;
} }
......
...@@ -181,5 +181,39 @@ WHERE s.`Status`=0 and s.Group_Id ={group_Id} and s.CustomerId in({customerIds}) ...@@ -181,5 +181,39 @@ WHERE s.`Status`=0 and s.Group_Id ={group_Id} and s.CustomerId in({customerIds})
WHERE o.OrderState in(1,2) and o.Group_Id ={group_Id} and o.CustomerId in({customerIds}) GROUP BY o.CustomerId"; WHERE o.OrderState in(1,2) and o.Group_Id ={group_Id} and o.CustomerId in({customerIds}) GROUP BY o.CustomerId";
return Get<RB_Customer_Extend>(sql).ToList(); return Get<RB_Customer_Extend>(sql).ToList();
} }
/// <summary>
/// 同行统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Customer_Extend> GetCustomerStaticRepository(RB_Customer_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.CreateBy,COUNT(1) AS CustomerCount
FROM RB_Customer AS A
WHERE 1=1
");
builder.AppendFormat(" A.{0}={1} ", nameof(RB_Customer_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" A.{0}={1} ", nameof(RB_Customer_Extend.Group_Id), query.Group_Id);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" A.{0}={1} ", nameof(RB_Customer_Extend.CreateBy), query.CreateBy);
}
if (!string.IsNullOrEmpty(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);
}
}
builder.AppendFormat(@" GROUP BY A.CreateBy ");
return Get<RB_Customer_Extend>(builder.ToString()).ToList();
}
} }
} }
...@@ -254,5 +254,39 @@ WHERE 1=1 ...@@ -254,5 +254,39 @@ WHERE 1=1
return Get<RB_Visitor_Reserve_Extend>(builder.ToString(), parameters).ToList(); return Get<RB_Visitor_Reserve_Extend>(builder.ToString(), parameters).ToList();
} }
/// <summary>
/// 试听课统计
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Visitor_Reserve_Extend> GetVisitorReserveStaticRepository(RB_Visitor_Reserve_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.CreateBy,COUNT(1) AS TrialLessonCount
FROM RB_Visitor_Reserve AS A
WHERE 1=1
");
builder.AppendFormat(" A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.Group_Id), query.Group_Id);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.CreateBy), query.CreateBy);
}
if (!string.IsNullOrEmpty(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);
}
}
builder.AppendFormat(@" GROUP BY A.CreateBy ");
return Get<RB_Visitor_Reserve_Extend>(builder.ToString()).ToList();
}
} }
} }
...@@ -115,6 +115,14 @@ WHERE 1=1 ...@@ -115,6 +115,14 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND t.{0} in({1}) ", nameof(RB_Student_ViewModel.StuId), query.StuIds); builder.AppendFormat(" AND t.{0} in({1}) ", nameof(RB_Student_ViewModel.StuId), query.StuIds);
} }
if (query.StuStage > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.StuStage), (int)query.StuStage);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.CreateBy), query.CreateBy);
}
} }
return Get<RB_Student_ViewModel>(builder.ToString(), parameters).ToList(); return Get<RB_Student_ViewModel>(builder.ToString(), parameters).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