@@ -336,7 +336,7 @@ where b.`Status`=0 and b.ClassStatus in(1,2) and a.status=0 and a.Account_Id={
varparameters=newDynamicParameters();
StringBuilderbuilder=newStringBuilder();
builder.AppendFormat($@"
SELECT s.*,sog.GuestId,o.OrderState,cou.CourseName,cou.CourseId,c.ClassName,c.ClassId,c.ClassStatus,sch.SName,sch.SId,t.TeacherName,o.EnterID, if((og.ValidClassHours-og.CompleteHours)<0,0,(og.ValidClassHours-og.CompleteHours)) as SurplusHours
SELECT s.*,sog.GuestId,o.OrderState,cou.CourseName,cou.CourseId,cou.B2BIcon,cou.B2BBackground,c.ClassName,c.ClassId,c.ClassStatus,sch.SName,sch.SId,t.TeacherName,o.EnterID,og.TotalHours,og.CompleteHours, if((og.ValidClassHours-og.CompleteHours)<0,0,(og.ValidClassHours-og.CompleteHours)) as SurplusHours
FROM rb_student as s LEFT JOIN rb_student_orderguest as sog on s.StuId=sog.Student_Id
LEFT JOIN rb_order_guest as og on og.Id=sog.GuestId
LEFT JOIN rb_order as o on og.OrderId=o.OrderId
...
...
@@ -344,7 +344,7 @@ FROM rb_student as s LEFT JOIN rb_student_orderguest as sog on s.StuId=sog.Stude
LEFT JOIN rb_class as c on c.ClassId=o.ClassId
LEFT JOIN rb_school as sch on sch.SId=c.School_Id
LEFT JOIN rb_teacher as t on t.TId=c.Teacher_Id
WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState=1 and cou.`Status`=0 and c.`Status`=0 and s.`Status`=0 and s.StuId={Student_Id} and s.Group_Id={Group_Id}");
WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState <>2 and cou.`Status`=0 and c.`Status`=0 and s.`Status`=0 and s.StuId={Student_Id} and s.Group_Id={Group_Id}");
@@ -196,7 +196,7 @@ where og.Status =0 and o.Group_Id ={group_Id} and o.OrderState <>3 and o.OrderTy
inner join rb_order o on og.OrderId = o.OrderId
where og.Status =0 and o.Group_Id ={group_Id} and o.OrderState <>3 and o.OrderType =2 and og.Student_Id ={accountId}) as StudyAbroadNum,";
sql+=$@"(select count(0) from RB_Student_OrderGuest og
inner join rb_education_contract ec on ec.GuestId = o.GuestId
inner join rb_education_contract ec on ec.GuestId = og.GuestId
inner join rb_order o on og.OrderId = o.OrderId
where og.Status =0 and ec.Group_Id ={group_Id} and ec.Status <>4 and o.OrderState <>3 and o.OrderType =1 and og.Student_Id ={accountId}) as ContractNum";
...
...
@@ -209,14 +209,14 @@ where og.Status =0 and ec.Group_Id ={group_Id} and ec.Status <>4 and o.OrderStat
stringsql=$@"SELECT og.*,o.CourseId FROM rb_student_orderguest og
stringsql=$@"SELECT og.*,o.CourseId,c.ClassStatus,c.ClassName FROM rb_student_orderguest og
INNER JOIN rb_order_guest g on og.GuestId = g.Id
INNER JOIN rb_order o on og.OrderId = o.OrderId
INNER JOIN rb_class c on o.ClassId = c.ClassId
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}
ORDER BY c.OpenTime ASC LIMIT 1";
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?"c.ClassStatus =2":"c.ClassStatus <>2")}
ORDER BY {(Type==1?"c.OpenTime asc":"c.OpenTime desc")} LIMIT 1";