diff --git a/app/controllers/subjects_controller.rb b/app/controllers/subjects_controller.rb index 676af6036..47c4d6a60 100644 --- a/app/controllers/subjects_controller.rb +++ b/app/controllers/subjects_controller.rb @@ -464,10 +464,10 @@ class SubjectsController < ApplicationController elsif params[:type] == "user_info" @subject.subject_user_infos else - @subject.subject_course_records - select_sql = "count(*) total, sum(course_count) course_count, sum(student_count) student_count, " + + select_sql = "count(subject_course_records.*) total, sum(course_count) course_count, sum(student_count) student_count, " + "sum(choice_shixun_num) choice_shixun_num, sum(choice_shixun_frequency) choice_shixun_frequency" @total = @subject.subject_course_records.select("#{select_sql}").first + @subject.subject_course_records end @data_count = @data.count