学生试用申请的自动激活
This commit is contained in:
parent
cb9e28f907
commit
a295fe1990
|
|
@ -586,9 +586,19 @@ class AccountController < ApplicationController
|
|||
|
||||
def apply_trail
|
||||
apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization", :status => 0).first
|
||||
if apply_action.blank?
|
||||
if User.current.user_extensions.identity == 1 && !User.current.user_extensions.student_id.nil? && User.current.user_extensions.student_id != "" && !User.current.user_extensions.school.nil?
|
||||
User.current.update_attributes(:certification => 1)
|
||||
@tip = "申请成功,我们将在一分钟内完成审核"
|
||||
if apply_action.blank?
|
||||
ApplyAction.create(:user_id => User.current.id, :status => 1, :container_type => "TrialAuthorization", :apply_reason => params[:apply_reason])
|
||||
else
|
||||
apply_action.update_attributes(:status => 1)
|
||||
end
|
||||
else
|
||||
@tip = "申请成功,我们将在一个工作日内完成审核"
|
||||
ApplyAction.create(:user_id => User.current.id, :status => 0, :container_type => "TrialAuthorization", :apply_reason => params[:apply_reason])
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
$("body").append('<%= j( render :partial => 'welcome/one_btn_mask_pop', :locals => {:btn => "确定", :tip1 => "申请成功,我们将在一个工作日内完成审核", :url => "#{my_account_path()}"}) %>');
|
||||
$("body").append('<%= j( render :partial => 'welcome/one_btn_mask_pop', :locals => {:btn => "确定", :tip1 => @tip, :url => "#{my_account_path()}"}) %>');
|
||||
Loading…
Reference in New Issue