From 3f698f502c86db58e888503eca3e052125f5f864 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 3 Sep 2019 16:18:49 +0800 Subject: [PATCH] admins: fix import user --- app/services/admins/import_user_service.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/services/admins/import_user_service.rb b/app/services/admins/import_user_service.rb index a07d29641..f3408051b 100644 --- a/app/services/admins/import_user_service.rb +++ b/app/services/admins/import_user_service.rb @@ -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