|
|
|
@ -114,9 +114,7 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
|
new_team.team_members.create!(user_id: user_id, role: 3, competition_id: @competition.id, is_teacher: 1)
|
|
|
|
|
end
|
|
|
|
|
# 创建时,记录是否是引流用户
|
|
|
|
|
# ip = request.remote_ip
|
|
|
|
|
# ua = UserAgent.find_by_ip(ip)
|
|
|
|
|
# ua.update_column(:type, UserAgent::COMPETITION) if ua
|
|
|
|
|
record_agent_user_action
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -230,10 +228,8 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
team.team_members.create!(user_id: User.current.id, role: 2, competition_id: @competition.id)
|
|
|
|
|
# # 创建时,记录是否是引流用户
|
|
|
|
|
# ip = request.remote_ip
|
|
|
|
|
# ua = UserAgent.find_by_ip(ip)
|
|
|
|
|
# ua.update_column(:type, UserAgent::COMPETITION) if ua
|
|
|
|
|
# 记录引流
|
|
|
|
|
record_agent_user_action
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -351,7 +347,7 @@ class CompetitionTeamsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def record_agent_user_action
|
|
|
|
|
# 注册时,记录是否是引流用户
|
|
|
|
|
# 记录是否是引流用户的行为
|
|
|
|
|
ip = request.remote_ip
|
|
|
|
|
ua = UserAgent.find_by_ip(ip)
|
|
|
|
|
ua.update_column(:type, UserAgent::COMPETITION) if ua
|
|
|
|
|