diff --git a/app/controllers/graduation_tasks_controller.rb b/app/controllers/graduation_tasks_controller.rb index da3c680ce..2475ded42 100644 --- a/app/controllers/graduation_tasks_controller.rb +++ b/app/controllers/graduation_tasks_controller.rb @@ -513,7 +513,9 @@ class GraduationTasksController < ApplicationController page = params[:page] ? params[:page].to_i : 1 limit = params[:limit] ? params[:limit].to_i : 10 @work_list = @task.graduation_works.joins("join course_members on graduation_works.user_id=course_members.user_id"). - where(course_members: {course_group_id: group_ids}).page(page).per(limit).includes(user: [:user_extension]) + where(course_members: {course_group_id: group_ids}) + @user_count = @work_list.size + @work_list = @work_list.page(page).per(limit).includes(user: [:user_extension]) @students = @course.students.where(user_id: @work_list.pluck(:user_id)) end diff --git a/app/views/graduation_tasks/cross_comment_setting.json.jbuilder b/app/views/graduation_tasks/cross_comment_setting.json.jbuilder index 72cae6eba..a10343c0b 100644 --- a/app/views/graduation_tasks/cross_comment_setting.json.jbuilder +++ b/app/views/graduation_tasks/cross_comment_setting.json.jbuilder @@ -10,7 +10,7 @@ json.work_users @work_list do |work| end end -json.user_count @work_list.size +json.user_count @user_count json.course_groups @course_groups do |group| json.(group, :id, :name)