SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,ec.ContractNo,ec.Id as ContractId,IFNULL(C.SName,'') AS SchoolName,IFNULL(D.ClassName,'') AS ClassName,IFNULL(T.TeacherName,'') AS TeacherName
,IFNULL(E.EnterID,0) AS EnterID,IFNULL(F.CourseName,'') AS CourseName,D.ClassNo,B.TotalHours,B.CompleteHours
,IFNULL(E.EnterID,0) AS EnterID,IFNULL(F.CourseName,'') AS CourseName,D.ClassNo,B.TotalHours,B.CompleteHours,IFNULL(G.Id,0) AS BackClassProtocolId,IFNULL(G.ProtocolNum,'') AS ProtocolNum
FROM RB_Student_BackClass AS A LEFT JOIN rb_order_guest AS B ON A.GuestId=B.Id
LEFT JOIN rb_education_contract ec on B.Id = ec.GuestId and ec.Status <>4
LEFT JOIN rb_class AS D ON A.ClassId=D.ClassId
...
...
@@ -66,7 +66,8 @@ FROM RB_Student_BackClass AS A LEFT JOIN rb_order_guest AS B ON A.GuestId=B.Id
AS T ON A.TeacherId=T.Id
LEFT JOIN rb_order AS E ON A.OrderId=E.OrderId
LEFT JOIN rb_course AS F ON D.CouseId=F.CourseId
WHERE 1=1 ");
LEFT JOIN rb_backclass_protocol AS G ON A.BackId=G.BackId