diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index af1dffe71..2478633a1 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -186,7 +186,7 @@ class HomeworkCommonsController < ApplicationController end @work_count = @student_works.size - @work_excel = @student_works + @work_excel = @student_works.includes(:student_works_scores) @students = @course.students # 分页参数 @@ -207,6 +207,7 @@ class HomeworkCommonsController < ApplicationController tip_exception(403, "无权限操作") else if @work_excel.present? + @homework = @homework.includes() student_work_to_xlsx(@work_excel,@homework) exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S') diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 6a8edee71..81e6cedaa 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -1005,11 +1005,6 @@ class PollsController < ApplicationController if @poll_users_list.present? && @poll_users_list.count > 0 - if order == "student_id" - @poll_users_list = @poll_users_list.joins(user: [:user_extension]).order("user_extensions.student_id DESC") - else - @poll_users_list = @poll_users_list.order("end_at DESC") - end #答题状态的选择 if choose_type.present? @@ -1028,6 +1023,12 @@ class PollsController < ApplicationController @poll_users_list = @poll_users_list.joins(user: :user_extension).where("CONCAT(lastname, firstname) like ? OR student_id like ?", "%#{search_content}%", "%#{search_content}%") end + if order == "student_id" + @poll_users_list = @poll_users_list.joins(user: :user_extension).order("user_extensions.student_id DESC") + else + @poll_users_list = @poll_users_list.order("end_at DESC") + end + logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:user_id)}") @poll_users_size = @poll_users_list.count