|
@@ -879,9 +879,7 @@
|
|
|
LEFT JOIN organization o ON o.id_ = mg.organ_id_
|
|
|
LEFT JOIN student_visit sv ON sv.student_id_ = sr.user_id_ AND sv.purpose_ = '会员续费'
|
|
|
<if test="hasMember != null">
|
|
|
- <if test="hasMember == 2">
|
|
|
- LEFT JOIN cloud_teacher_order cto ON cto.student_id_ = sr.user_id_
|
|
|
- </if>
|
|
|
+ LEFT JOIN cloud_teacher_order cto ON cto.student_id_ = sr.user_id_ AND cto.music_group_id_ IS NOT NULL AND cto.status_ = 1
|
|
|
</if>
|
|
|
<include refid="queryMusicMemberListSql"/>
|
|
|
</select>
|
|
@@ -906,9 +904,7 @@
|
|
|
LEFT JOIN organization o ON o.id_ = mg.organ_id_
|
|
|
LEFT JOIN student_visit sv ON sv.student_id_ = sr.user_id_ AND sv.purpose_ = '会员续费'
|
|
|
<if test="hasMember != null">
|
|
|
- <if test="hasMember == 2">
|
|
|
- LEFT JOIN cloud_teacher_order cto ON cto.student_id_ = sr.user_id_
|
|
|
- </if>
|
|
|
+ LEFT JOIN cloud_teacher_order cto ON cto.student_id_ = sr.user_id_ AND cto.music_group_id_ IS NOT NULL AND cto.status_ = 1
|
|
|
</if>
|
|
|
<include refid="queryMusicMemberListSql"/>
|
|
|
GROUP BY sr.user_id_
|
|
@@ -931,13 +927,13 @@
|
|
|
</if>
|
|
|
<if test="hasMember != null">
|
|
|
<if test="hasMember == 0">
|
|
|
- AND (sr.membership_end_time_ IS NULL OR sr.membership_end_time_ < NOW())
|
|
|
+ AND cto.id_ IS NULL AND (sr.membership_end_time_ IS NULL OR sr.membership_end_time_ < NOW())
|
|
|
</if>
|
|
|
<if test="hasMember == 1">
|
|
|
- AND DATEDIFF(sr.membership_end_time_,NOW()) <= #{memberEndAutoQuitMusic} AND sr.membership_end_time_ > NOW()
|
|
|
+ AND cto.id_ IS NULL AND DATEDIFF(sr.membership_end_time_,NOW()) <= #{memberEndAutoQuitMusic} AND sr.membership_end_time_ > NOW()
|
|
|
</if>
|
|
|
<if test="hasMember == 2">
|
|
|
- AND cto.status_ = 1 AND cto.music_group_id_ IS NOT NULL
|
|
|
+ AND cto.id_ IS NOT NULL
|
|
|
</if>
|
|
|
</if>
|
|
|
<if test="visitStartTime != null">
|