ecloud_sso
anke1460 5 years ago
parent eb373f10d6
commit e888de0c6a

@ -18,7 +18,12 @@ namespace :tfxy do
teach_data_last_row = teach_data.last_row
2.upto(teach_data_last_row) do |r|
old_user = User.where("phone = '#{teach_data.cell(r, 5)}' OR mail = '#{teach_data.cell(r, 6)}' OR login = 'tfxy#{teach_data.cell(r, 1)}' " ).first
if teach_data.cell(r, 6).to_s&.strip.present?
old_user = User.where("phone = '#{teach_data.cell(r, 5)}' OR mail = '#{teach_data.cell(r, 6).to_s.strip}' OR login = 'tfxy#{teach_data.cell(r, 1)}' " ).first
else
old_user = User.where("phone = '#{teach_data.cell(r, 5)}' OR login = 'tfxy#{teach_data.cell(r, 1)}' ").first
end
if !old_user.present?
user = User.new(
@ -29,7 +34,7 @@ namespace :tfxy do
lastname: teach_data.cell(r, 2),
nickname: teach_data.cell(r, 2),
password: "Edu#{teach_data.cell(r, 5)}",
mail: teach_data.cell(r, 6),
mail: teach_data.cell(r, 6).to_s&.strip.present? ? teach_data.cell(r, 6).to_s&.strip : nil,
profile_completed: true,
professional_certification: 1,
certification: 1,

Loading…
Cancel
Save