Commit df8e929d authored by 段英荣's avatar 段英荣

modify

parent 184cd5ce
......@@ -98,9 +98,10 @@ class CollectData(object):
logging.info("consume topic_id:%s,device_id:%s" % (str(topic_id), str(device_id)))
tag_list = list()
sql_query_results = TopicTag.objects.using(settings.SLAVE_DB_NAME).filter(is_online=True, topic_id=topic_id)
for sql_item in sql_query_results:
tag_list.append(sql_item.tag_id)
click_sql_query_results = TopicTag.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=topic_id).values_list("tag_id","is_online")
for sql_item in click_sql_query_results:
if sql_item.is_online:
tag_list.append(sql_item.tag_id)
is_click = 1
is_vote = 0
......@@ -135,9 +136,10 @@ class CollectData(object):
topic_tag_id_dict = dict()
tag_list = list()
sql_query_results = TopicTag.objects.using(settings.SLAVE_DB_NAME).filter(is_online=True, topic_id__in=exposure_topic_id_list)
for sql_item in sql_query_results:
tag_list.append(sql_item.tag_id)
exposure_sql_query_results = TopicTag.objects.using(settings.SLAVE_DB_NAME).filter(topic_id__in=exposure_topic_id_list).values_list("tag_id","is_online")
for sql_item in exposure_sql_query_results:
if sql_item.is_online:
tag_list.append(sql_item.tag_id)
if sql_item.topic_id not in topic_tag_id_dict:
topic_tag_id_dict[sql_item.topic_id] = list()
......
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