dev_aliyun
daiao 6 years ago
parent a8ebde3ce6
commit d71c423c9a

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

Loading…
Cancel
Save