|
@@ -13,7 +13,7 @@ from video_recall import PoolRecall
|
|
|
from video_rank import video_rank, bottom_strategy, video_rank_by_w_h_rate, video_rank_with_old_video, bottom_strategy2
|
|
|
from db_helper import RedisHelper
|
|
|
import gevent
|
|
|
-from utils import FilterVideos
|
|
|
+from utils import FilterVideos, get_user_has30day_return
|
|
|
import ast
|
|
|
|
|
|
log_ = Log()
|
|
@@ -515,12 +515,13 @@ def update_local_distribute_count(videos):
|
|
|
log_.error(traceback.format_exc())
|
|
|
|
|
|
|
|
|
-def get_recommend_params(recommend_type, ab_exp_info, ab_info_data, page_type=0):
|
|
|
+def get_recommend_params(recommend_type, ab_exp_info, ab_info_data, mid, page_type=0):
|
|
|
"""
|
|
|
根据实验分组给定对应的推荐参数
|
|
|
:param recommend_type: 首页推荐和相关推荐区分参数(0-首页推荐,1-相关推荐)
|
|
|
:param ab_exp_info: AB实验组参数
|
|
|
:param ab_info_data: app实验组参数
|
|
|
+ :param mid: mid
|
|
|
:param page_type: 页面区分参数,默认:0(首页)
|
|
|
:return:
|
|
|
"""
|
|
@@ -544,6 +545,9 @@ def get_recommend_params(recommend_type, ab_exp_info, ab_info_data, page_type=0)
|
|
|
data_key = config_.AB_EXP_CODE['095'].get('data_key')
|
|
|
no_op_flag = True
|
|
|
|
|
|
+
|
|
|
+ user_30day_return_result = get_user_has30day_return(mid=mid)
|
|
|
+
|
|
|
|
|
|
if ab_exp_info:
|
|
|
ab_exp_code_list = []
|
|
@@ -559,7 +563,8 @@ def get_recommend_params(recommend_type, ab_exp_info, ab_info_data, page_type=0)
|
|
|
config_value_dict[str(ab_exp_code)] = ab_item.get('configValue', None)
|
|
|
|
|
|
if '136' in ab_exp_code_list:
|
|
|
- if user_type == 'click':
|
|
|
+
|
|
|
+ if user_30day_return_result is False:
|
|
|
param = config_.AB_EXP_CODE.get('136')
|
|
|
ab_code = param.get('ab_code')
|
|
|
expire_time = 3600
|
|
@@ -567,7 +572,8 @@ def get_recommend_params(recommend_type, ab_exp_info, ab_info_data, page_type=0)
|
|
|
data_key = param.get('data_key')
|
|
|
no_op_flag = True
|
|
|
elif '137' in ab_exp_code_list:
|
|
|
- if user_type == 'share':
|
|
|
+
|
|
|
+ if user_30day_return_result is True:
|
|
|
param = config_.AB_EXP_CODE.get('137')
|
|
|
ab_code = param.get('ab_code')
|
|
|
expire_time = 3600
|