SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,IFNULL(C.JoinType,0) AS StuJoinType,IFNULL(D.GuestState,0) AS StuGuestState
SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,IFNULL(C.JoinType,0) AS StuJoinType,IFNULL(D.GuestState,0) AS StuGuestState
...
@@ -178,11 +179,16 @@ WHERE 1=1 AND C.OrderState<>3 AND D.Status=0
...
@@ -178,11 +179,16 @@ WHERE 1=1 AND C.OrderState<>3 AND D.Status=0
}
}
if(query.IsNotContract==1)
if(query.IsNotContract==1)
{
{
builder.AppendFormat(" AND C.OrderType=1 and C.CourseId<>1 ");
builder.AppendFormat(" AND C.OrderType=1 and C.CourseId<>1 AND stu.School_Id NOT IN(6,7,9) ");
builder.AppendFormat(@" AND NOT EXISTS(SELECT 1 FROM rb_education_contract WHERE A.OrderId=OrderId AND A.GuestId=GuestId AND `Status` NOT IN(4)) ");
builder.AppendFormat(@" AND NOT EXISTS(SELECT 1 FROM rb_education_contract WHERE A.OrderId=OrderId AND A.GuestId=GuestId AND `Status` NOT IN(4)) ");
}
}
if(!string.IsNullOrEmpty(query.KeyWords))
{
builder.Append(" AND (A.OrderId LIKE @KeyWords OR stu.StuName LIKE @KeyWords OR stu.WeChatNo LIKE @KeyWords OR stu.StuRealMobile LIKE @KeyWords) ");