Browse Source

云教练活动

zouxuan 3 years ago
parent
commit
7f402a4fb4

+ 3 - 3
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -1828,10 +1828,10 @@
 		<result property="buyNum" column="buy_num_"/>
 	</resultMap>
     <select id="countCloudTeacherActive" resultMap="CloudTeacherActiveTargetDto">
-		SELECT o.name_ organ_name_,o.id_ organ_id_,CASE WHEN SUM(spo.actual_amount_) IS NULL THEN 0 ELSE SUM(spo.actual_amount_) END buy_amount_,
-		COUNT(DISTINCT spo.user_id_) buy_num_,COUNT(s.user_id_) total_num_ FROM student s
+		SELECT o.name_ organ_name_,o.id_ organ_id_,CASE WHEN SUM(cto.amount_) IS NULL THEN 0 ELSE SUM(cto.amount_) END buy_amount_,
+		COUNT(DISTINCT cto.student_id_) buy_num_,COUNT(s.user_id_) total_num_ FROM student s
 		LEFT JOIN sys_user su ON su.id_ = s.user_id_
-		LEFT JOIN student_payment_order spo ON spo.user_id_ = s.user_id_ AND spo.type_ = 'RENEW' AND spo.status_ = 'SUCCESS'
+		LEFT JOIN cloud_teacher_order cto ON cto.student_id_ = s.user_id_
 		LEFT JOIN organization o ON o.id_ = su.organ_id_
 		WHERE s.count_flag_ = 1
 		<if test="organIdList != null and organIdList.size > 0">