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 50784ee74..84af9b584 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -1004,8 +1004,8 @@ class PollsController < ApplicationController search_content = params[:search] if @poll_users_list.present? && @poll_users_list.count > 0 - #答题状态的选择 + # if choose_type.present? @poll_users_list = @poll_users_list.commit_by_status(choose_type) end @@ -1021,12 +1021,14 @@ class PollsController < ApplicationController if search_content.present? @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.joins(user: :user_extension).order("end_at DESC") end - logger.info("#######user_id: ####{@poll_users_list.pluck(:id, :user_id)}") + + logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:user_id)}") @poll_users_size = @poll_users_list.count