stringsql=$@"SELECT COUNT(0) AS IsSelectLevelNor,max(c.FreeCoffeeNum) as FreeCoffeeNum FROM rb_account a
stringsql=$@"SELECT COUNT(0) AS IsSelectLevelNor,max(IFNULL(c.FreeCoffeeNum,0)) as FreeCoffeeNum, max(o.CourseId) as LeaveStatus FROM rb_account a
INNER JOIN rb_student s on a.AccountId = s.StuId
INNER JOIN rb_student_orderguest sog on sog.Student_Id = s.StuId
INNER JOIN rb_order_guest og on sog.GuestId = og.Id
...
...
@@ -289,7 +289,8 @@ left join rb_course c on o.CourseId = c.CourseId
WHERE a.`Status` =0 and a.AccountType =4 and a.Id ={accountId} and og.GuestState not in(2,7) and o.OrderState =1 and o.OrderType =1 and og.TotalHours > og.CompleteHours";