From eef49ea6635350fe4e49f2ebadafac9e2f9f7460 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Fri, 28 Feb 2020 02:48:49 +0800 Subject: [PATCH] fix --- lib/tasks/tfxy.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/tfxy.rake b/lib/tasks/tfxy.rake index 6faa78ecf..89e5e4367 100644 --- a/lib/tasks/tfxy.rake +++ b/lib/tasks/tfxy.rake @@ -157,8 +157,8 @@ namespace :tfxy do 2.upto(student_data_last_row) do |r| # 邮箱存在 - if student_data.cell(r, 9).present? - old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR mail = '#{student_data.cell(r, 9)}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first + if student_data.cell(r, 9).strip.present? + old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR mail = '#{student_data.cell(r, 9).strip}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first else old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first end @@ -172,7 +172,7 @@ namespace :tfxy do lastname: student_data.cell(r, 2), nickname: student_data.cell(r, 2), password: "Edu#{student_data.cell(r, 1)}", - mail: student_data.cell(r, 9), + mail: student_data.cell(r, 9).strip, profile_completed: true, professional_certification: 1, certification: 1,