Commit 2cc5d28c authored by kai's avatar kai

update

parent dd36f106
......@@ -314,12 +314,12 @@ class Topic(models.Model):
return []
def get_latest_reply_date(self):
try:
reply_query_results = Reply.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id,is_delete=0,is_online=1).values("user_id", "create_time")
reply_query_results = Reply.objects.using(settings.SLAVE_DB_NAME).filter(topic_id=self.id,is_deleted=0,is_online=1).values("user_id", "create_time")
datetime_list = list()
if reply_query_results.count() > 0:
for reply in reply_query_results:
UserExtra_results = UserExtra.objects.using(settings.SLAVE_DB_NAME).filter(user_id = reply['user_id'])
if UserExtra_results['is_shadow']:
if not UserExtra_results['is_shadow']:
datetime_list.append(reply['create_time'])
return max(datetime_list)
else:
......
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