Commit 64a788ff authored by 段英荣's avatar 段英荣

Revert "update"

This reverts commit 7edf476c
parent 7edf476c
...@@ -24,5 +24,29 @@ ...@@ -24,5 +24,29 @@
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" /> <option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings> </formatting-settings>
</DBN-SQL> </DBN-SQL>
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
</code_scheme> </code_scheme>
</component> </component>
\ No newline at end of file
...@@ -349,7 +349,7 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic ...@@ -349,7 +349,7 @@ def topic_detail_page_recommend(device_id="", user_id=-1, topic_id=-1, topic_pic
topic_tag_result = list() topic_tag_result = list()
result = list() result = list()
if len(topic_tag_list) != 0: if len(topic_tag_list) != 0:
topic_tag_result = TopicUtils.top_get_topic_detail_recomtmend_list(user_id,topic_id,have_read_topic_list,size,es_cli_obj, topic_tag_result = TopicUtils.top_get_topic_detail_recommend_list(user_id,topic_id,have_read_topic_list,size,es_cli_obj,
index_type="topic",routing="3,4,5,6",topic_tag_list = topic_tag_list) index_type="topic",routing="3,4,5,6",topic_tag_list = topic_tag_list)
topic_tag_size = len(topic_tag_result) topic_tag_size = len(topic_tag_result)
have_read_topic_list.extend(topic_tag_result) have_read_topic_list.extend(topic_tag_result)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
"create_time_val":{"type":"long"}, "create_time_val":{"type":"long"},
"update_time_val":{"type":"long"}, "update_time_val":{"type":"long"},
"language_type":{"type":"long"}, "language_type":{"type":"long"},
"latest_reply_time":{"type":"date", "format":"date_time_no_millis"},
"is_shadow": {"type": "boolean"}, "is_shadow": {"type": "boolean"},
"is_recommend": {"type": "boolean"}, "is_recommend": {"type": "boolean"},
"is_complaint": {"type": "boolean"}, // 是否被举报 "is_complaint": {"type": "boolean"}, // 是否被举报
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"group_id":{"type":"long"}, //所在组ID "group_id":{"type":"long"}, //所在组ID
"tag_list":{"type":"long"},//标签属性 "tag_list":{"type":"long"},//标签属性
"useful_tag_list":{"type":"long"},//有用标签属性 "useful_tag_list":{"type":"long"},//有用标签属性
"latest_reply_time":{"type":"date", "format":"date_time_no_millis"},
"edit_tag_list":{"type":"long"},//编辑标签 "edit_tag_list":{"type":"long"},//编辑标签
"tag_name_list":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"}, "tag_name_list":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"},
"share_num":{"type":"long"}, "share_num":{"type":"long"},
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"group_id":{"type":"long"}, //所在组ID "group_id":{"type":"long"}, //所在组ID
"tag_list":{"type":"long"},//标签属性 "tag_list":{"type":"long"},//标签属性
"useful_tag_list":{"type":"long"},//有用标签属性 "useful_tag_list":{"type":"long"},//有用标签属性
"latest_reply_time":{"type":"date", "format":"date_time_no_millis"},
"edit_tag_list":{"type":"long"},//编辑标签 "edit_tag_list":{"type":"long"},//编辑标签
"tag_name_list":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"}, "tag_name_list":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"},
"share_num":{"type":"long"}, "share_num":{"type":"long"},
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"group_id":{"type":"long"}, //所在组ID "group_id":{"type":"long"}, //所在组ID
"tag_list":{"type":"long"},//标签属性 "tag_list":{"type":"long"},//标签属性
"useful_tag_list":{"type":"long"},//有用标签属性 "useful_tag_list":{"type":"long"},//有用标签属性
"latest_reply_time":{"type":"date", "format":"date_time_no_millis"},
"edit_tag_list":{"type":"long"},//编辑标签 "edit_tag_list":{"type":"long"},//编辑标签
"tag_name_list":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"}, "tag_name_list":{"type":"text","analyzer":"gm_default_index","search_analyzer":"gm_default_index"},
"share_num":{"type":"long"}, "share_num":{"type":"long"},
......
...@@ -312,20 +312,7 @@ class Topic(models.Model): ...@@ -312,20 +312,7 @@ class Topic(models.Model):
except: except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return [] 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")
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']:
datetime_list.append(reply['create_time'])
return max(datetime_list)
else:
return 0
except:
return 0
class TopicComplaint(models.Model): class TopicComplaint(models.Model):
"""帖子举报""" """帖子举报"""
...@@ -397,16 +384,3 @@ class TopicBillBoard(models.Model): ...@@ -397,16 +384,3 @@ class TopicBillBoard(models.Model):
pictorial_id = models.IntegerField(verbose_name=u"榜单ID") pictorial_id = models.IntegerField(verbose_name=u"榜单ID")
real_vote_cnt = models.IntegerField(verbose_name=u"真实赞") real_vote_cnt = models.IntegerField(verbose_name=u"真实赞")
virt_vote_cnt = models.IntegerField(verbose_name=u"虚拟赞") virt_vote_cnt = models.IntegerField(verbose_name=u"虚拟赞")
class Reply(models.Model):
"""帖子回复"""
class Meta:
verbose_name = "帖子回复"
db_table = "reply"
topic_id = models.IntegerField(verbose_name=u"帖子ID")
user_id = models.IntegerField(verbose_name=u'用户ID')
create_time = models.DateTimeField(verbose_name=u'创建时间')
is_deleted = models.BooleanField(verbose_name=u'是否删除')
is_online = models.BooleanField(verbose_name=u'是否上线')
\ No newline at end of file
...@@ -78,9 +78,6 @@ class TopicTransfer(object): ...@@ -78,9 +78,6 @@ class TopicTransfer(object):
# begin = time.time() # begin = time.time()
topic_useful_tag_id_list = instance.get_topic_useful_tag_id_list() topic_useful_tag_id_list = instance.get_topic_useful_tag_id_list()
res["useful_tag_list"] = topic_useful_tag_id_list res["useful_tag_list"] = topic_useful_tag_id_list
latest_reply_time = instance.get_latest_reply_date()
res["latest_reply_time"] = latest_reply_time
# end = time.time() # end = time.time()
# time5 = (end - begin) # time5 = (end - begin)
# # 片假名 # # 片假名
......
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