Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_new_shixunsrepository
cxt 5 years ago
commit 9e6691703e

@ -655,6 +655,7 @@ class User < ApplicationRecord
# 邮箱w***l@qq.com # 邮箱w***l@qq.com
def hidden_mail def hidden_mail
Rails.logger.info("######-----: #{mail}")
Util.conceal(mail, :email).to_s Util.conceal(mail, :email).to_s
end end

@ -3,7 +3,7 @@ class Videos::DispatchCallbackService < ApplicationService
def initialize(params) def initialize(params)
@video = Video.find_by(uuid: params[:VideoId]) @video = Video.find_by(uuid: params[:VideoId])
@params = params`` @params = params
end end
def call def call

@ -18,7 +18,12 @@ namespace :tfxy do
teach_data_last_row = teach_data.last_row teach_data_last_row = teach_data.last_row
2.upto(teach_data_last_row) do |r| 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? if !old_user.present?
user = User.new( user = User.new(
@ -29,7 +34,7 @@ namespace :tfxy do
lastname: teach_data.cell(r, 2), lastname: teach_data.cell(r, 2),
nickname: teach_data.cell(r, 2), nickname: teach_data.cell(r, 2),
password: "Edu#{teach_data.cell(r, 5)}", 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, profile_completed: true,
professional_certification: 1, professional_certification: 1,
certification: 1, certification: 1,
@ -157,8 +162,8 @@ namespace :tfxy do
2.upto(student_data_last_row) do |r| 2.upto(student_data_last_row) do |r|
# 邮箱存在 # 邮箱存在
if student_data.cell(r, 9).strip.present? if student_data.cell(r, 9).to_s&.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 old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR mail = '#{student_data.cell(r, 9).to_s.strip}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first
else else
old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first old_user = User.where("phone = '#{student_data.cell(r, 8)}' OR login = 'tfxy#{student_data.cell(r, 1)}' " ).first
end end
@ -172,7 +177,7 @@ namespace :tfxy do
lastname: student_data.cell(r, 2), lastname: student_data.cell(r, 2),
nickname: student_data.cell(r, 2), nickname: student_data.cell(r, 2),
password: "Edu#{student_data.cell(r, 1)}", password: "Edu#{student_data.cell(r, 1)}",
mail: student_data.cell(r, 9).strip, mail: student_data.cell(r, 9).to_s&.strip.present? ? student_data.cell(r, 9).to_s&.strip : nil,
profile_completed: true, profile_completed: true,
professional_certification: 1, professional_certification: 1,
certification: 1, certification: 1,
@ -205,7 +210,6 @@ namespace :tfxy do
else else
# 系统已有用户关联sso认证用户 # 系统已有用户关联sso认证用户
old_user.update( old_user.update(
login: "tfxy#{student_data.cell(r, 1)}",
lastname: student_data.cell(r, 2), lastname: student_data.cell(r, 2),
nickname: student_data.cell(r, 2), nickname: student_data.cell(r, 2),
certification: true, certification: true,

Loading…
Cancel
Save