From 319b3c1d0eeec23d0d43b6c8163b5693e97d1fc6 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 3 Jun 2019 11:18:45 +0800 Subject: [PATCH] fix management school grow data incorrent --- .../management/school_data_grow_service.rb | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/services/management/school_data_grow_service.rb b/app/services/management/school_data_grow_service.rb index 7afe87af..e86ba52e 100644 --- a/app/services/management/school_data_grow_service.rb +++ b/app/services/management/school_data_grow_service.rb @@ -21,14 +21,14 @@ class Management::SchoolDataGrowService reports = reports.select( 'schools.id school_id, schools.name school_name,'\ - 'SUM(teacher_increase_count) teacher_increase_count,'\ - 'SUM(student_increase_count) student_increase_count,'\ - 'SUM(course_increase_count) course_increase_count,'\ - 'SUM(shixun_increase_count) shixun_increase_count,'\ - 'SUM(shixun_homework_count) shixun_homework_count,'\ - 'SUM(shixun_evaluate_count) shixun_evaluate_count,'\ - 'COUNT(distinct(au.user_id)) uniq_active_user_count,'\ - 'SUM(active_user_count) active_user_count' + 'SUM(distinct teacher_increase_count) teacher_increase_count,'\ + 'SUM(distinct student_increase_count) student_increase_count,'\ + 'SUM(distinct course_increase_count) course_increase_count,'\ + 'SUM(distinct shixun_increase_count) shixun_increase_count,'\ + 'SUM(distinct shixun_homework_count) shixun_homework_count,'\ + 'SUM(distinct shixun_evaluate_count) shixun_evaluate_count,'\ + 'COUNT(distinct au.user_id) uniq_active_user_count,'\ + 'SUM(distinct active_user_count) active_user_count' ) reports = custom_sort(reports, params[:sort_by], params[:sort_direction]) @@ -40,14 +40,14 @@ class Management::SchoolDataGrowService def grow_summary @_grow_summary ||= begin query_reports.select( - 'SUM(teacher_increase_count) teacher_increase_count,'\ - 'SUM(student_increase_count) student_increase_count,'\ - 'SUM(course_increase_count) course_increase_count,'\ - 'SUM(shixun_increase_count) shixun_increase_count,'\ - 'SUM(shixun_homework_count) shixun_homework_count,'\ - 'SUM(shixun_evaluate_count) shixun_evaluate_count,'\ - 'COUNT(distinct(au.user_id)) uniq_active_user_count,'\ - 'SUM(active_user_count) active_user_count' + 'SUM(distinct teacher_increase_count) teacher_increase_count,'\ + 'SUM(distinct student_increase_count) student_increase_count,'\ + 'SUM(distinct course_increase_count) course_increase_count,'\ + 'SUM(distinct shixun_increase_count) shixun_increase_count,'\ + 'SUM(distinct shixun_homework_count) shixun_homework_count,'\ + 'SUM(distinct shixun_evaluate_count) shixun_evaluate_count,'\ + 'COUNT(distinct au.user_id) uniq_active_user_count,'\ + 'SUM(distinct active_user_count) active_user_count' ).first end end