|
|
|
@ -349,9 +349,7 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
|
def record_agent_user_action
|
|
|
|
|
# 注册时,记录是否是引流用户
|
|
|
|
|
ip = @env['HTTP_X_REAL_IP']
|
|
|
|
|
ua = UserAgent.where(:ip => ip, :type => UserAgent::AD).take
|
|
|
|
|
if ua && UserAgent.where(:ip => ip, :type => UserAgent::COMPETITION).blank?
|
|
|
|
|
UserAgent.create(:key => ua.key, :ip => ip, :type => UserAgent::COMPETITION, :user_id => User.current.id)
|
|
|
|
|
end
|
|
|
|
|
ua = UserAgent.find_by_id(:ip => ip)
|
|
|
|
|
ua.update_column(:type, UserAgent::COMPETITION) if ua
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|