admins: fix import user

dev_hss
p31729568 6 years ago
parent 38d33e990d
commit 3f698f502c

@ -55,7 +55,9 @@ class Admins::ImportUserService < ApplicationService
professional_certification: 1,
certification: 1,
password: '12345678',
phone: data.phone
phone: data.phone,
mail: "#{prefix}#{data.student_id}@qq.com",
profile_completed: true
}
ActiveRecord::Base.transaction do
user = User.create!(attr)
@ -67,8 +69,8 @@ class Admins::ImportUserService < ApplicationService
extension_attr[:technical_title] =
case data.identity.to_i
when 0 then %w(教授 副教授 讲师 助教).include?(data.technical_title) || '讲师'
when 2 then %w(企业管理者 部门管理者 高级工程师 工程师 助理工程师).include?(data.technical_title) || '助理工程师'
when 0 then %w(教授 副教授 讲师 助教).include?(data.technical_title) ? data.technical_title : '讲师'
when 2 then %w(企业管理者 部门管理者 高级工程师 工程师 助理工程师).include?(data.technical_title) ? data.technical_title : '助理工程师'
else nil
end

Loading…
Cancel
Save