用户引流数据

dev_aliyun
daiao 5 years ago
parent de3a76fee9
commit 4228780e85

@ -35,7 +35,7 @@ module Mobile
ip = @env['HTTP_X_REAL_IP']
ua = UserAgent.find_by_ip(ip)
if ua.blank?
UserAgent.create!(:key => params[:edu].strip, :ip => ip, :type => UserAgent::USER_AD)
UserAgent.create!(:key => params[:edu].strip, :ip => ip, :agent_type => UserAgent::USER_AD)
end
end
MemosService.new.show params, current_user

@ -380,7 +380,7 @@ class AccountController < ApplicationController
# 注册时,记录是否是引流用户
ip = request.remote_ip
ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::USER_REGISTER) if ua
ua.update_column(:agent_type, UserAgent::USER_REGISTER) if ua
if !@user.new_record?
self.logged_user = @user
flash[:notice] = l(:notice_account_activated)

@ -350,6 +350,6 @@ class CompetitionTeamsController < ApplicationController
# 记录是否是引流用户的行为
ip = request.remote_ip
ua = UserAgent.find_by_ip(ip)
ua.update_column(:type, UserAgent::USER_COMPETITION) if ua
ua.update_column(:agent_type, UserAgent::USER_COMPETITION) if ua
end
end

@ -0,0 +1,8 @@
class ModifyTypeForUserAgents < ActiveRecord::Migration
def up
rename_column :user_agents, :type, :agent_type
end
def down
end
end
Loading…
Cancel
Save