用户注册的时候,如果选用的是老师身份,则给雅菲手机发送一条短信

dev_trainings
cxt 6 years ago
parent afc01ad67b
commit 7d34217b9e

@ -456,7 +456,9 @@ class AccountController < ApplicationController
@pref = @user.pref @pref = @user.pref
@se = @user.extensions @se = @user.extensions
# 已授权的用户修改单位名称,需要重新授权 old_identity = @se.identity
# 已授权的用户修改单位名称,需要重新授权
if @se.school_id != params[:occupation].to_i && @user.certification == 1 if @se.school_id != params[:occupation].to_i && @user.certification == 1
@user.certification = 0 @user.certification = 0
apply_user = ApplyAction.where(:user_id => @user.id, :container_type => "TrialAuthorization") apply_user = ApplyAction.where(:user_id => @user.id, :container_type => "TrialAuthorization")
@ -510,10 +512,15 @@ class AccountController < ApplicationController
@se.technical_title = params[:pro_technical_title] if params[:pro_technical_title] @se.technical_title = params[:pro_technical_title] if params[:pro_technical_title]
@se.student_id = nil @se.student_id = nil
end end
# @se.brief_introduction = params[:brief_introduction] # @se.brief_introduction = params[:brief_introduction]
if @user.save && @se.save if @user.save && @se.save
if old_identity.nil? && @se.identity == 0
Trustie::Sms.send(mobile: '17680641960', send_type:'teacher_register', name: @user.login, user_name: "管理员")
end
reward_grade(@user, @user.id, 'Account', 500) reward_grade(@user, @user.id, 'Account', 500)
if @user.certification != 1 if @user.certification != 1

@ -31,6 +31,8 @@ module Trustie
params['text'] = "" params['text'] = ""
if send_type.nil? if send_type.nil?
params['text'] = "【Edu实训】" + code + "(手机验证码)。如非本人操作,请忽略。" params['text'] = "【Edu实训】" + code + "(手机验证码)。如非本人操作,请忽略。"
elsif send_type == "teacher_register"
params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理"
elsif send_type == 'competition_start' elsif send_type == 'competition_start'
params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛" params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛"
Rails.logger.info "#{params['text']}" Rails.logger.info "#{params['text']}"

Loading…
Cancel
Save