zouxuan 3 mesi fa
parent
commit
5901532f8b

+ 6 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -60,7 +60,8 @@
                 sum(if(a.end_time_ <= now(),1,0)) as expTime,
                 sum(if(a.end_time_ > now(),1,0)) as unExpTime
             from course_schedule a
-            where a.lock_ = 0 and a.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE','GROUP')
+            LEFT JOIN course_group cg ON cg.id_ = a.course_group_id_
+            where a.lock_ = 0 AND cg.status_ IN ('COMPLETE','ING')
             <if test="userId != null and userId != ''">
                 and a.teacher_id_ = #{userId}
             </if>
@@ -72,8 +73,9 @@
                 a.teacher_id_ as userId,
                 avg (b.score_) as starGrade
             from course_schedule a
+            LEFT JOIN course_group cg ON cg.id_ = a.course_group_id_
             join course_schedule_replied b on a.id_ = b.course_schedule_id_
-            where a.lock_ = 0 and a.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE','GROUP') and b.score_ is not null
+            where a.lock_ = 0 AND cg.status_ IN ('COMPLETE','ING') and b.score_ is not null
             <if test="userId != null and userId != ''">
                 and a.teacher_id_ = #{userId}
             </if>
@@ -93,7 +95,8 @@
         from student t
         left join course_schedule_student_payment a on t.user_id_ = a.user_id_
         left join course_schedule b on a.course_id_ = b.id_
-        where b.lock_ = 0 and b.type_ in ('PRACTICE','PIANO_ROOM_CLASS','VIP','LIVE','GROUP')
+        LEFT JOIN course_group cg ON cg.id_ = b.course_group_id_
+        where b.lock_ = 0 AND cg.status_ IN ('COMPLETE','ING')
             <if test="userId != null and userId != ''">
                 and t.user_id_ = #{userId}
             </if>