Commit 3ab5c18e authored by 谢祁峰's avatar 谢祁峰

fix

parents 68a8205c 4140e006
...@@ -636,7 +636,7 @@ class CollectData(object): ...@@ -636,7 +636,7 @@ class CollectData(object):
logging.info("action=api/v1/cards/topic") logging.info("action=api/v1/cards/topic")
tag_name = data["APP"].get("query", []) tag_name = data["APP"].get("query", [])
tag_list = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter( tag_list = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter(
name=tag_name).values_list("id")) name=tag_name).values_list("id",flat=True))
device_id = data["SYS"]["cl_id"] device_id = data["SYS"]["cl_id"]
user_id = data['SYS'].get('user_id', None) user_id = data['SYS'].get('user_id', None)
self.transfer_update_recommend_tag_list(device_id, user_feature, user_id, self.transfer_update_recommend_tag_list(device_id, user_feature, user_id,
...@@ -654,14 +654,15 @@ class CollectData(object): ...@@ -654,14 +654,15 @@ class CollectData(object):
tag_ids = list(data["APP"].get("tag_ids", [])) tag_ids = list(data["APP"].get("tag_ids", []))
tag_list = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter( tag_list = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter(
id__in=tag_ids, is_online=True, is_deleted=False, id__in=tag_ids, is_online=True, is_deleted=False,
is_category=False).values_list("id")) is_category=False).values_list("id",flat=True))
tag_query_results_multi = [i for i in tag_ids if i in tag_list]
device_id = data["SYS"]["cl_id"] device_id = data["SYS"]["cl_id"]
user_id = data['SYS'].get('user_id', None) user_id = data['SYS'].get('user_id', None)
self.transfer_update_recommend_tag_list(device_id, user_feature, user_id, self.transfer_update_recommend_tag_list(device_id, user_feature, user_id,
tag_list, tag_query_results_multi,
10) 10)
logging.info("%s,device_id:%s,tag_list:%s" % (action, logging.info("%s,device_id:%s,tag_list:%s" % (action,
str(device_id), str(tag_list))) str(device_id), str(tag_query_results_multi)))
# 创建问题关注标签关键字进linucb # 创建问题关注标签关键字进linucb
elif 'SYS' in data and 'APP' in data and 'action' in data['SYS'] and \ elif 'SYS' in data and 'APP' in data and 'action' in data['SYS'] and \
"venus/sun/pictorial/edit" in str(data['SYS'].get('action',"")): "venus/sun/pictorial/edit" in str(data['SYS'].get('action',"")):
...@@ -671,26 +672,29 @@ class CollectData(object): ...@@ -671,26 +672,29 @@ class CollectData(object):
tag_ids = list(data["APP"].get("tag_ids", [])) tag_ids = list(data["APP"].get("tag_ids", []))
tag_list = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter( tag_list = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter(
id__in=tag_ids, is_online=True, is_deleted=False, id__in=tag_ids, is_online=True, is_deleted=False,
is_category=False).values_list("id")) is_category=False).values_list("id",flat=True))
tag_query_results_multi = [i for i in tag_ids if i in tag_list]
device_id = data["SYS"]["cl_id"] device_id = data["SYS"]["cl_id"]
user_id = data['SYS'].get('user_id', None) user_id = data['SYS'].get('user_id', None)
self.transfer_update_recommend_tag_list(device_id, user_feature, user_id, self.transfer_update_recommend_tag_list(device_id, user_feature, user_id,
tag_list, tag_query_results_multi,
20) 20)
logging.info("%s,device_id:%s,tag_list:%s" % (action, logging.info("%s,device_id:%s,tag_list:%s" % (action,
str(device_id), str(tag_list))) str(device_id), str(tag_query_results_multi)))
# kyc最后一题 # kyc最后一题
elif 'SYS' in data and 'APP' in data and 'action' in data['SYS'] and \ elif 'SYS' in data and 'APP' in data and 'action' in data['SYS'] and \
"venus/community/survey_question/record_kyc_last_question" in str(data['SYS'].get('action',"")): "venus/community/survey_question/record_kyc_last_question" in str(data['SYS'].get('action',"")):
action = str(data['SYS'].get('action', '')) action = str(data['SYS'].get('action', ''))
tag_ids = list(data["APP"].get("tag_ids", [])) tag_ids = list(data["APP"].get("tag_ids", []))
logging.info('action:%s,tag_list:%s' % (action,str(tag_ids)))
logging.info('action:%s,tag_list:%s' % (action, str(tag_ids)))
tag_query_results = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter( tag_query_results = list(Tag.objects.using(settings.SLAVE1_DB_NAME).filter(
id__in=tag_ids, is_online=True, is_deleted=False, id__in=tag_ids, is_online=True, is_deleted=False,
is_category=False).values_list("id")) is_category=False).values_list("id",flat=True))
tag_query_results = [i[0] for i in tag_query_results] # tag_query_results = [i[0] for i in tag_query_results]
logging.info('action:%s,mysql query taglist:%s'% (action,str(tag_query_results))) logging.info('action:%s,mysql query taglist:%s' % (action, str(tag_query_results)))
tag_query_results_multi = [i for i in tag_ids if i in tag_query_results] tag_query_results_multi = [i for i in tag_ids if i in tag_query_results]
device_id = data["SYS"]["cl_id"] device_id = data["SYS"]["cl_id"]
user_id = data['SYS'].get('user_id', None) user_id = data['SYS'].get('user_id', None)
...@@ -698,7 +702,9 @@ class CollectData(object): ...@@ -698,7 +702,9 @@ class CollectData(object):
tag_query_results_multi, tag_query_results_multi,
5) 5)
logging.info("action:%s,device_id:%s,tag_list:%s" % (action, logging.info("action:%s,device_id:%s,tag_list:%s" % (action,
str(device_id), str(tag_query_results_multi)))
str(device_id),
str(tag_query_results_multi)))
else: else:
if msg: if msg:
logging.warning( logging.warning(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment