Commit 899f1d8e authored by 李小芳's avatar 李小芳

smr

parent cc85a7f9
......@@ -196,7 +196,7 @@ def get_answers(pks):
# 首页精选增加内容分类 明星列表和网红列表
tagv4 = answer.get_answer_tagv4_names(answer_id=answer.id)
if tagv4:
tags_info = answer.get_tag(tagv4)
tags_info = answer.get_answer_tag(tagv4)
item['selected_stars'] = []
item['selected_internet_celebrity'] = []
all_tags = []
......
......@@ -1085,6 +1085,19 @@ class Answer(models.Model):
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return 1000
def get_answer_tag(self, tag_list):
try:
association_tags_id_list = list()
tag_list = TagService._get_by_ids_from_cache_type(tag_list)
for item in tag_list:
association_tags_id_list.append(
{"id": item.id, "tag_name": item.name, "recommend_type": item.recommend_type,
"tag_type": item.tag_type})
return association_tags_id_list
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return []
class SendAnswer(models.Model):
class Meta:
......
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