Commit 5c62173d authored by Kai's avatar Kai

test

parent 537bad5c
......@@ -155,6 +155,10 @@ class CollectData(object):
tag_list = list()
click_topic_tag_list = list()
collection_tag_sql_query_results = TopicTag.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=topic_id).values_list("tag_id","is_online","is_collection")
for tag_id,is_online,is_collection in collection_tag_sql_query_results:
if is_online and is_collection:
click_topic_tag_list.append(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 tag_id,is_online in click_sql_query_results:
......@@ -163,9 +167,10 @@ class CollectData(object):
tag_sql_query_results = Tag.objects.using(settings.SLAVE_DB_NAME).filter(
id=tag_id).values_list("id", "collection", "is_ai")
for id, collection, is_ai in tag_sql_query_results:
if collection == 1 or is_ai == 1:
if (collection == 1 or is_ai == 1) and id not in click_topic_tag_list:
click_topic_tag_list.append(id)
is_click = 1
is_vote = 0
......
......@@ -19,6 +19,9 @@ class TopicTag(models.Model):
tag_id = models.IntegerField(verbose_name=u"标签ID")
topic_id = models.IntegerField(verbose_name=u"帖子ID")
is_online = models.BooleanField(verbose_name=u"是否在线")
is_collection = models.BooleanField(verbose_name=u"是否编辑标签")
class AccountUserTag(models.Model):
......
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