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
def hidden_mail
Rails.logger.info("######-----: #{mail}")
Util.conceal(mail, :email).to_s
end

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

@ -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,
@ -157,8 +162,8 @@ namespace :tfxy do
2.upto(student_data_last_row) do |r|
# 邮箱存在
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
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).to_s.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 +177,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).strip,
mail: student_data.cell(r, 9).to_s&.strip.present? ? student_data.cell(r, 9).to_s&.strip : nil,
profile_completed: true,
professional_certification: 1,
certification: 1,
@ -205,13 +210,12 @@ namespace :tfxy do
else
# 系统已有用户关联sso认证用户
old_user.update(
login: "tfxy#{student_data.cell(r, 1)}",
lastname: student_data.cell(r, 2),
nickname: student_data.cell(r, 2),
certification: true,
professional_certification: true,
authentication: true,
profile_completed: true)
lastname: student_data.cell(r, 2),
nickname: student_data.cell(r, 2),
certification: true,
professional_certification: true,
authentication: true,
profile_completed: true)
OpenUsers::Cas.find_or_create_by(uid: student_data.cell(r, 1)) do |u|
u.extra = {phone: student_data.cell(r, 8)}

Loading…
Cancel
Save