Commit 1e506e3f authored by 吴春's avatar 吴春

1

parent bc7ca74a
......@@ -125,6 +125,7 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public int EnterID { get; set; }
/// <summary>
/// 剩余课时
/// </summary>
......@@ -150,6 +151,12 @@ namespace Edu.Model.ViewModel.User
/// </summary>
public decimal OrderIncome { get; set; }
/// <summary>
/// 订单退款
/// </summary>
public decimal Refund { get; set; }
/// <summary>
/// 续费订单数量
/// </summary>
......@@ -232,7 +239,7 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 试听次数
/// </summary>
public int TrialLessonCount{get;set;}
public int TrialLessonCount { get; set; }
/// <summary>
/// 同行
......@@ -292,7 +299,7 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 学习目的名称
/// </summary>
public string StuPurposeName { get; set;}
public string StuPurposeName { get; set; }
/// <summary>
/// 客户需求名称
......
This diff is collapsed.
......@@ -462,7 +462,8 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.IsSureConsultTime), 1);
}
else {
else
{
builder.AppendFormat(" AND t.{0}<>{1} ", nameof(RB_Student_ViewModel.IsSureConsultTime), 1);
}
}
......@@ -594,8 +595,8 @@ GROUP BY GuestId";
//内部介绍=>直接修改内部介绍人为学员创建人【HK2023-06-15调整为不改变原创建人员】
else if (model.CreateType == StuCreateTypeEnum.InternalIntroduction)
{
//创建人不变
// model.CreateBy = model.StuSourceId;
//创建人不变
// model.CreateBy = model.StuSourceId;
}
model.StuTel = Common.Plugin.StringHelper.ReplaceMobile(model.StuRealMobile);
......@@ -1253,5 +1254,108 @@ group by s.StuId";
WHERE Group_Id ={group_Id} and `Status` =0 and IsSureConsultTime =1 and CreateTime>='{sDate}' and CreateTime <='{eDate} 23:59:59' GROUP BY CreateBy";
return Get<RB_Student_ViewModel>(sql).ToList();
}
/// <summary>
/// 获取学生分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_ViewModel> GetStudentMonthPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Student_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT t.StuId, t.StuName, t.StuTel, t.StuIcon, t.StuSex, t.StuBirth, t.Group_Id, t.School_Id, t.Status, t.CreateBy, t.IsDisable, t.StuStatus, t.Interest, t.JapanBaseInfo,t. CustomerId,t. StuProfession, t.StuEducation, t.StuPurpose, t.StuSource, t.StuAddress, t.StuContract, t.StuContractMobile, t.StuIDCard, t.StuIDCardAddress,t. CreateType, t.StuStage, t.StuChannel,t. PlatformName, t.StuSourceId,t. QQ, t.WeChatNo, t.StuType,t. StuNeeds, t.StuRealMobile, t.ConsultDate, t.PlanPrice, t.BaseCondition,t. DemandPoint, t.ResistPoint,t. ConsultingResults, t.FirstEnrollDate, t.AdvisorStatus, t.AdvisorWinRate,t. AdvisorExpectDate, t.FileVoucher, t.IsSureConsultTime,g.GroupName,s.SName,IFNULL(a.Account,'') AS StudentAccount ,c.CustomerName,IFNULL(B.Name,'') AS AdvisorStatusName,cou.CourseName,o.PreferPrice as OrderIncome,o.Refund,o.CreateTime
FROM rb_order as o LEFT JOIN rb_order_guest as og on og.OrderId=o.OrderId
left JOIN rb_student_orderguest as sog on og.Id=sog.GuestId
left JOIN rb_student AS t on t.StuId=sog.Student_Id
LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
LEFT JOIN rb_school AS s ON t.School_Id=s.SId
LEFT JOIN rb_customer c on (c.CustomerId = t.StuSourceId AND t.CreateType=2)
LEFT JOIN rb_account as a ON (t.StuId=a.AccountId AND a.AccountType=4 )
LEFT JOIN rb_student_advisorconfig AS b ON t.AdvisorStatus=B.Id
LEFT JOIN rb_course as cou on o.CourseId=cou.CourseId where 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrEmpty(query.StartTime))
{
builder.AppendFormat(" AND o.CreateTime>='{0}' ", query.StartTime);
}
if (!string.IsNullOrEmpty(query.EndTime))
{
builder.AppendFormat(" AND o.CreateTime<='{0} 23:59:59' ", query.EndTime);
}
}
builder.AppendFormat(" ORDER BY o.CreateTime asc ");
return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取学生分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_ViewModel> GetStudentMonthListRepository( RB_Student_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT t.StuId, t.StuName, t.StuTel, t.StuIcon, t.StuSex, t.StuBirth, t.Group_Id, t.School_Id, t.Status, t.CreateBy, t.IsDisable, t.StuStatus, t.Interest, t.JapanBaseInfo,t. CustomerId,t. StuProfession, t.StuEducation, t.StuPurpose, t.StuSource, t.StuAddress, t.StuContract, t.StuContractMobile, t.StuIDCard, t.StuIDCardAddress,t. CreateType, t.StuStage, t.StuChannel,t. PlatformName, t.StuSourceId,t. QQ, t.WeChatNo, t.StuType,t. StuNeeds, t.StuRealMobile, t.ConsultDate, t.PlanPrice, t.BaseCondition,t. DemandPoint, t.ResistPoint,t. ConsultingResults, t.FirstEnrollDate, t.AdvisorStatus, t.AdvisorWinRate,t. AdvisorExpectDate, t.FileVoucher, t.IsSureConsultTime,g.GroupName,s.SName,IFNULL(a.Account,'') AS StudentAccount ,c.CustomerName,IFNULL(B.Name,'') AS AdvisorStatusName,cou.CourseName,o.PreferPrice as OrderIncome,o.Refund,o.CreateTime
FROM rb_order as o LEFT JOIN rb_order_guest as og on og.OrderId=o.OrderId
left JOIN rb_student_orderguest as sog on og.Id=sog.GuestId
left JOIN rb_student AS t on t.StuId=sog.Student_Id
LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
LEFT JOIN rb_school AS s ON t.School_Id=s.SId
LEFT JOIN rb_customer c on (c.CustomerId = t.StuSourceId AND t.CreateType=2)
LEFT JOIN rb_account as a ON (t.StuId=a.AccountId AND a.AccountType=4 )
LEFT JOIN rb_student_advisorconfig AS b ON t.AdvisorStatus=B.Id
LEFT JOIN rb_course as cou on o.CourseId=cou.CourseId where 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrEmpty(query.StartTime))
{
builder.AppendFormat(" AND o.CreateTime>='{0}' ", query.StartTime);
}
if (!string.IsNullOrEmpty(query.EndTime))
{
builder.AppendFormat(" AND o.CreateTime<='{0} 23:59:59' ", query.EndTime);
}
}
builder.AppendFormat(" ORDER BY o.CreateTime asc ");
return Get<RB_Student_ViewModel>(builder.ToString(), parameters).ToList();
}
}
}
\ 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