diff --git a/app/controllers/competitions/competitions_controller.rb b/app/controllers/competitions/competitions_controller.rb index 6ab7e83a0..a92170668 100644 --- a/app/controllers/competitions/competitions_controller.rb +++ b/app/controllers/competitions/competitions_controller.rb @@ -123,19 +123,19 @@ class Competitions::CompetitionsController < Competitions::BaseController @stage = @competition.competition_stages.take end - @records = @competition.competition_teams.joins(:competition_scores).where(competition_scores: {competition_stage_id: @stage&.id.to_i}) + @all_records = @competition.competition_teams.joins(:competition_scores).where(competition_scores: {competition_stage_id: @stage&.id.to_i}) .select("competition_teams.*, score, cost_time").order("score desc, cost_time desc") current_team_ids = @competition.team_members.where(user_id: current_user.id).pluck(:competition_team_id).uniq - @user_ranks = @records.select{|com_team| current_team_ids.include?(com_team.id)} - @records = @records.where("score > 0") + @user_ranks = @all_records.select{|com_team| current_team_ids.include?(com_team.id)} + @records = @all_records.where("score > 0") @record_ids = @records.pluck(:id) if params[:format] == "xlsx" @records = @records.includes(user: [user_extension: :school], team_members: :user) respond_to do |format| format.xlsx{ set_export_cookies - chart_to_xlsx(@records, @competition) + chart_to_xlsx(@all_records, @competition) exercise_export_name = "#{@competition.name}比赛成绩" render xlsx: "#{exercise_export_name.strip}",template: "competitions/competitions/chart_list.xlsx.axlsx",locals: {table_columns: @competition_head_cells, chart_lists: @competition_cells_column} diff --git a/app/views/admins/carousels/shared/_add_carousel_modal.html.erb b/app/views/admins/carousels/shared/_add_carousel_modal.html.erb index c3055e59e..5dd7bf475 100644 --- a/app/views/admins/carousels/shared/_add_carousel_modal.html.erb +++ b/app/views/admins/carousels/shared/_add_carousel_modal.html.erb @@ -14,7 +14,7 @@
图片
-
+
diff --git a/app/views/admins/enroll_lists/export.xlsx.axlsx b/app/views/admins/enroll_lists/export.xlsx.axlsx index b6f403ab8..303b48a07 100644 --- a/app/views/admins/enroll_lists/export.xlsx.axlsx +++ b/app/views/admins/enroll_lists/export.xlsx.axlsx @@ -14,14 +14,14 @@ wb.add_worksheet(name: '报名列表') do |sheet| @personal ? "--" : team.teachers_info, member_user.real_name, member_user.identity, - member_user.phone, + member_user.phone.present? ? (member_user.phone.to_s + "\t") : "--", member_user.mail, - member_user.student_id, + member_user.student_id.present? ? (member_user.student_id.to_s + "\t") : "--", member_user.authentication ? "√" : "", member_user.professional_certification ? "√" : "", member_user.school_name, member_user.school_province, - member.created_at.strftime('%Y-%m-%d %H:%M'), + team.created_at&.strftime('%Y-%m-%d %H:%M'), rank ] sheet.add_row(data)