@@ -89,7 +89,7 @@ WHERE 1=1 AND C.OrderState IN(1) AND D.Status=0
//课程等级
if(query.CourseRate>0)
{
builder.AppendFormat(" AND EXISTS(SELECT 1 FROM rb_course_chapter WHERE `Status`=0 AND CourseId=C.CourseId AND CourseRate IN({0}))",(int)query.CourseRate);
builder.AppendFormat(" AND EXISTS(SELECT 1 FROM rb_course_chapter WHERE `Status`=0 AND CourseId=C.CourseId AND CourseRate IN({0}))",(int)query.CourseRate);
}
//学员状态
if(query.StuGuestState>0)
...
...
@@ -163,7 +163,7 @@ GROUP BY A.Student_Id,A.OrderId
WHERE og.Status =0 and g.`Status` =0 and o.Group_Id ={group_Id} and o.OrderState <>3 and o.OrderType =1 and og.Student_Id ={accountId} and {(Type==1?"g.TotalHours > g.CompleteHours":"g.TotalHours <= g.CompleteHours")}
WHERE og.Status =0 and g.`Status` =0 and o.Group_Id ={group_Id} and o.OrderState <>3 and o.OrderType =1 and og.Student_Id ={accountId} and {(Type==1?"g.TotalHours > g.CompleteHours":"g.TotalHours <= g.CompleteHours")}
ORDER BY {(Type==1?"og.Id asc":"og.Id desc")} LIMIT 1";
sql+=$@" LEFT JOIN rb_student_follow f on s.StuId = f.StuId and f.`Status` =0 and f.AssistType in(2,4) and f.CreateTime >='{demodel.SFTime}' and f.CreateTime <='{demodel.EFTime} 23:59:59'";
where+=$" and og.GuestState ={(int)demodel.StuGuestState}";
}
if(demodel.Q_EnrollState>0){
if(demodel.Q_EnrollState>0)
{
if(demodel.Q_EnrollState==1)
{
where+=$" and o.OrderId is not null and c.CourseId <>1";//排除内部班
}
else{
else
{
where+=$" and o.OrderId is null";
}
}
...
...
@@ -949,7 +953,7 @@ LEFT JOIN rb_channel ch on s.StuChannel = ch.Id";
//增加跟进链表
sql+=$@" LEFT JOIN rb_student_follow f on s.StuId = f.StuId and f.`Status` =0 and f.AssistType =2 and f.CreateTime >='{demodel.SFTime}' and f.CreateTime <='{demodel.EFTime} 23:59:59'";