Commit 9a147ee1 authored by lixiaofang's avatar lixiaofang

add

parent ef9614a8
......@@ -96,6 +96,8 @@ class Topic(models.Model):
is_shadow = models.BooleanField(verbose_name="是否是马甲账户", default=False)
platform = models.IntegerField(verbose_name=u'平台来源', choices=GRAP_PLATFORM, default=GRAP_PLATFORM.ALPHA)
platform_id = models.BigIntegerField(verbose_name='用平台ID', null=True)
have_face = models.BooleanField(verbose_name=u"是否有图片", default=False)
def get_virtual_vote_num(self):
......
......@@ -24,10 +24,9 @@ def topic_has_image(topic_id):
try:
has_image = False
query_list = TopicImage.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=topic_id, is_deleted=False,
is_online=True)
if len(query_list) > 0:
has_image = True
query_list = Topic.objects.using(settings.SLAVE_DB_NAME).filter(id=topic_id, is_deleted=False,
is_online=True).values_list("have_face",
flat=True)
return has_image
except:
......
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