|
|
|
@ -24,22 +24,41 @@ module WelcomeHelper
|
|
|
|
|
|
|
|
|
|
# 引流注册情况
|
|
|
|
|
def register_info user_agent
|
|
|
|
|
if user_agent.agent_type.to_i == UserAgent::USER_AD
|
|
|
|
|
user_id = user_agent.user_actionss.first.try(:user_id)
|
|
|
|
|
if user_id && User.where("id = #{user_id} and created_on < '2019-07-15 00:00:00'").present?
|
|
|
|
|
"代理前注册"
|
|
|
|
|
else
|
|
|
|
|
"未转换"
|
|
|
|
|
end
|
|
|
|
|
elsif user_agent.agent_type.to_i == UserAgent::USER_REGISTER || UserActions.find_by_ip(user_agent.ip)
|
|
|
|
|
"代理后注册"
|
|
|
|
|
else
|
|
|
|
|
user_id = user_agent.user_actionss.first.try(:user_id)
|
|
|
|
|
if user_id && User.where("id = #{user_id} and created_on < '2019-07-15 00:00:00'").present?
|
|
|
|
|
"代理前注册"
|
|
|
|
|
else
|
|
|
|
|
"代理后注册"
|
|
|
|
|
end
|
|
|
|
|
case user_agent.register_status
|
|
|
|
|
when 0
|
|
|
|
|
"改IP未登录"
|
|
|
|
|
when 1
|
|
|
|
|
"代理之前注册"
|
|
|
|
|
when 2
|
|
|
|
|
"代理之后注册"
|
|
|
|
|
end
|
|
|
|
|
# if user_agent.agent_type.to_i == UserAgent::USER_AD
|
|
|
|
|
# user_id = user_agent.user_actionss.first.try(:user_id)
|
|
|
|
|
# if user_id && User.where("id = #{user_id} and created_on < '2019-07-15 00:00:00'").present?
|
|
|
|
|
# "代理前注册"
|
|
|
|
|
# else
|
|
|
|
|
# "未转换"
|
|
|
|
|
# end
|
|
|
|
|
# elsif user_agent.agent_type.to_i == UserAgent::USER_REGISTER || UserActions.find_by_ip(user_agent.ip)
|
|
|
|
|
# "代理后注册"
|
|
|
|
|
# else
|
|
|
|
|
# user_id = user_agent.user_actionss.first.try(:user_id)
|
|
|
|
|
# if user_id && User.where("id = #{user_id} and created_on < '2019-07-15 00:00:00'").present?
|
|
|
|
|
# "代理前注册"
|
|
|
|
|
# else
|
|
|
|
|
# "代理后注册"
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def competion_info user_agent
|
|
|
|
|
case user_agent.action_status
|
|
|
|
|
when 0
|
|
|
|
|
"未报名"
|
|
|
|
|
when 1
|
|
|
|
|
"代理之前报名"
|
|
|
|
|
when 2
|
|
|
|
|
"代理之后报名"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|