From f76d30689e2ee9ff8ea9d70fb2d86f4bc20d4300 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 26 Oct 2019 19:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../competitions/competitions_controller.rb | 2 +- app/helpers/export_helper.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/competitions/competitions_controller.rb b/app/controllers/competitions/competitions_controller.rb index 88f3a9a83..1059bfdac 100644 --- a/app/controllers/competitions/competitions_controller.rb +++ b/app/controllers/competitions/competitions_controller.rb @@ -176,7 +176,7 @@ class Competitions::CompetitionsController < Competitions::BaseController if personal row_cells_column << record_user.real_name row_cells_column << record_user.school_name - row_cells_column << record_user.student_id + row_cells_column << record_user.student_id.present? ? (record_user.student_id.to_s + "\t") : "--" else row_cells_column << record.name row_cells_column << record.teachers_name diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index 1274e07c7..36120266b 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -44,7 +44,7 @@ module ExportHelper w_2 = w_user&.login.present? ? w_user&.login : "--" w_3 = w_user&.real_name.present? ? w_user&.real_name : "--" w_3_1 = w_user&.mail.present? ? w_user.mail : "--" - w_4 = w_user.student_id.present? ? w_user.student_id : "--" + w_4 = w_user.student_id.present? ? (w_user.student_id.to_s + "\t") : "--" else w_2 = "--" w_3 = "--" @@ -132,7 +132,7 @@ module ExportHelper w_2 = w_user&.login.present? ? w_user&.login : "--" w_3 = w_user&.real_name.present? ? w_user&.real_name : "--" w_3_1 = w_user&.mail.present? ? w_user.mail : "--" - w_4 = w_user.student_id.present? ? w_user.student_id : "--" + w_4 = w_user.student_id.present? ? (w_user.student_id.to_s + "\t") : "--" course_name = course.students.find_by(user_id: w.user_id).try(:course_group_name) w_5 = course_name.present? ? course_name : "--" #0: 未提交, 1 按时提交, 2 延迟提交 @@ -217,7 +217,7 @@ module ExportHelper w_2 = w_user&.login.present? ? w_user&.login : "--" w_3 = w_user&.real_name.present? ? w_user&.real_name : "--" w_3_1 = w_user&.mail.present? ? w_user.mail : "--" - w_4 = w_user.student_id.present? ? w_user.student_id : "--" + w_4 = w_user.student_id.present? ? (w_user.student_id.to_s + "\t") : "--" w_5 = work.class_grouping_name if task_type_boolean #是否分组 w_6 = work.grouping_name @@ -311,7 +311,7 @@ module ExportHelper end user_start_time = e_user.start_at.present? ? e_user.start_at.strftime('%Y-%m-%d %H:%M') : "--" user_end_time = e_user.end_at.present? ? e_user.end_at.strftime('%Y-%m-%d %H:%M') : "--" - user_student_id = user_info.student_id.present? ? user_info.student_id : "--" + user_student_id = user_info.student_id.present? ? (user_info.student_id.to_s + "\t") : "--" user_login = user_info&.login.present? ? user_info.login : "--" user_real_name = user_info.real_name.present? ? user_info.real_name : "--" user_mail = user_info&.mail.present? ? user_info.mail : "--" @@ -373,7 +373,7 @@ module ExportHelper w_2 = user&.login.present? ? user&.login : "--" w_3 = user&.real_name.present? ? user&.real_name : "--" w_3_1 = user&.mail.present? ? user.mail : "--" - w_4 = user.student_id.present? ? user.student_id : "--" + w_4 = user.student_id.present? ? (user.student_id.to_s + "\t") : "--" w_5 = student&.course_group_name.present? ? student.course_group_name : "--" w_6 = topic.present? ? topic.name : "--" w_7 = topic.present? ? topic.teacher.full_name : "--"