|
|
|
@ -25,8 +25,8 @@ module WelcomeHelper
|
|
|
|
|
# 引流注册情况
|
|
|
|
|
def register_info user_agent
|
|
|
|
|
if user_agent.agent_type.to_i == UserAgent::USER_AD
|
|
|
|
|
user_id = UserActions.find_by_ip(user_agent.ip).try(:user_id)
|
|
|
|
|
if user_id && UserActions.where("user_id = #{user_id} and created_at < '2019-07-15 00:00:00'").present?
|
|
|
|
|
user_id = user_agent.user_actionss.first.try(:user_id)
|
|
|
|
|
if user_id && User.where("user_id = #{user_id} and created_on < '2019-07-15 00:00:00'").present?
|
|
|
|
|
"代理前注册"
|
|
|
|
|
else
|
|
|
|
|
"未转换"
|
|
|
|
@ -34,8 +34,8 @@ module WelcomeHelper
|
|
|
|
|
elsif user_agent.agent_type.to_i == UserAgent::USER_REGISTER || UserActions.find_by_ip(user_agent.ip)
|
|
|
|
|
"代理后注册"
|
|
|
|
|
else
|
|
|
|
|
user_id = UserActions.find_by_ip(user_agent.ip).try(:user_id)
|
|
|
|
|
if user_id && UserActions.where("user_id = #{user_id} and created_at < '2019-07-15 00:00:00'").present?
|
|
|
|
|
user_id = user_agent.user_actionss.first.try(:user_id)
|
|
|
|
|
if user_id && User.where("user_id = #{user_id} and created_on < '2019-07-15 00:00:00'").present?
|
|
|
|
|
"代理前注册"
|
|
|
|
|
else
|
|
|
|
|
"代理后注册"
|
|
|
|
|