SELECT A.*,IFNULL(B.`Name`,'') AS VisitorName,C.ClassDate,C.ClassTime,C.EndTime,C.ClassContent,IFNULL(D.TeacherName,'') AS TeacherName
,IFNULL(E.RoomName,'') AS RoomName,F.Id AS AccountId,IFNULL(G.LessonName,'') AS LessonName
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_visitor AS B ON A.Visitor_Id=B.Id
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
FROM RB_Visitor_Reserve AS A LEFT JOIN rb_student AS B ON A.Visitor_Id=B.StuId
LEFT JOIN rb_reserve_class AS C ON A.ReserveClassId=C.ReserveClassId
LEFT JOIN rb_teacher AS D ON C.TeacherId=D.TId
LEFT JOIN rb_account AS F On C.TeacherId=F.AccountId AND F.AccountType=2
LEFT JOIN rb_class_room AS E ON C.ClassRoomId=E.RoomId
LEFT JOIN rb_triallesson AS G ON C.TrialLessonId=G.Id
LEFT JOIN rb_triallesson AS F ON C.TrialLessonId=F.Id
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.Status),(int)DateStateEnum.Normal);
...
...
@@ -84,6 +83,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.Visitor_Id),query.Visitor_Id);
}
if(query.ReserveClassId>0)
{
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Visitor_Reserve_Extend.ReserveClassId),query.ReserveClassId);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ",nameof(RB_Visitor_Reserve_Extend.Id));