Commit aab7c37f authored by 吴春's avatar 吴春

1

parent f4a7a4c4
......@@ -200,5 +200,10 @@ namespace Edu.Model.ViewModel.Reserve
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
/// <summary>
/// 查询没有开班的约课信息
/// </summary>
public int IsQNotReserveClassId { get; set; }
}
}
......@@ -31,7 +31,7 @@ namespace Edu.Repository.Reserve
builder.Append(@"
SELECT A.*,IFNULL(B.StuName,'') AS VisitorName,C.ClassDate,C.ClassTime,C.EndTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName,IFNULL(E.RoomName,'') AS RoomName
,IFNULL(B.StuTel,'') AS StuTel,IFNULL(F.LessonName,'') AS LessonName,IFNULL(B.QQ,'') AS QQ,IFNULL(B.WeChatNo,'') AS WeChatNo,C.ReserveType,C.ClassPlanId
,IFNULL(G.OrderCount,0) AS OrderCount,c.ClassRoomId,C.TeacherId,c.TrialLessonId
,IFNULL(G.OrderCount,0) AS OrderCount,c.ClassRoomId,C.TeacherId,c.TrialLessonId,st.StuName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN
(
......@@ -43,6 +43,7 @@ FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN rb_teacher AS D ON C.TeacherId=D.TId
LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId
LEFT JOIN rb_triallesson AS F ON C.TrialLessonId=F.Id
LEFT JOIN rb_student as st on st.StuId=a.Visitor_Id
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.Status), (int)DateStateEnum.Normal);
......@@ -52,13 +53,27 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.StartClassDate))
if (query.IsQNotReserveClassId == 1)
{
builder.AppendFormat(" AND C.{0}>='{1}' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.StartClassDate);
if (!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Visitor_Reserve_Extend.ReservationDate), query.StartClassDate);
}
if (!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Visitor_Reserve_Extend.ReservationDate), query.EndClassDate);
}
}
if (!string.IsNullOrEmpty(query.EndClassDate))
else
{
builder.AppendFormat(" AND C.{0}<='{1} 23:59:59' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.EndClassDate);
if (!string.IsNullOrEmpty(query.StartClassDate))
{
builder.AppendFormat(" AND C.{0}>='{1}' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.StartClassDate);
}
if (!string.IsNullOrEmpty(query.EndClassDate))
{
builder.AppendFormat(" AND C.{0}<='{1} 23:59:59' ", nameof(RB_Visitor_Reserve_Extend.ClassDate), query.EndClassDate);
}
}
if (query.TeacherId > 0)
{
......@@ -99,6 +114,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.ReserveClassId), query.ReserveClassId);
}
if (query.IsQNotReserveClassId == 1)
{
builder.AppendFormat(" AND A.{0}=0 ", nameof(RB_Visitor_Reserve_Extend.ReserveClassId));
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Visitor_Reserve_Extend.Id));
return GetPage<RB_Visitor_Reserve_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
......@@ -50,7 +50,8 @@ namespace Edu.WebApi.Controllers.Duty
IsQueryAll = base.ParmJObj.GetInt("IsQueryAll"),
Visitor_Id = base.ParmJObj.GetInt("Visitor_Id"),
ReserveClassId = base.ParmJObj.GetInt("ReserveClassId"),
IsReserve = base.ParmJObj.GetInt("IsReserve", 1),
IsReserve = base.ParmJObj.GetInt("IsReserve", 1),
IsQNotReserveClassId = base.ParmJObj.GetInt("IsQNotReserveClassId", 0),
};
if (query.IsQueryAll != 1)
{
......@@ -161,7 +162,7 @@ namespace Edu.WebApi.Controllers.Duty
model.UpdateBy = base.UserInfo.Id;
model.UpdateTime = System.DateTime.Now;
model.Status = Common.Enum.DateStateEnum.Normal;
if (model.TeacherId == 0 || model.ClassRoomId == 0 || model.TrialLessonId == 0 || string.IsNullOrWhiteSpace(model.EndTime) || string.IsNullOrWhiteSpace(model.ClassTime) )
if (model.TeacherId == 0 || model.ClassRoomId == 0 || model.TrialLessonId == 0 || string.IsNullOrWhiteSpace(model.EndTime) || string.IsNullOrWhiteSpace(model.ClassTime))
{
return ApiResult.ParamIsNull();
}
......
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