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

modify

parent 184cd5ce
......@@ -98,8 +98,9 @@ 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:
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
......@@ -135,8 +136,9 @@ 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:
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:
......
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