Commit 3eebb97c authored by 李小芳's avatar 李小芳

Merge branch 'add_hauxiang' into 'master'

Add hauxiang

See merge request !4
parents fe7ae4f3 07550381
...@@ -14,6 +14,7 @@ import time ...@@ -14,6 +14,7 @@ import time
import datetime import datetime
from django.conf import settings from django.conf import settings
import redis import redis
rpc = get_rpc_invoker() rpc = get_rpc_invoker()
...@@ -83,7 +84,7 @@ def get_answers(pks): ...@@ -83,7 +84,7 @@ def get_answers(pks):
item["content_star_first_keyword"] = get_content_star_first_keyword(id=answer.id, content_type="answer") item["content_star_first_keyword"] = get_content_star_first_keyword(id=answer.id, content_type="answer")
# item["title_keyword"] = get_content_title_keywords(id=answer.id, content_type="answer") # item["title_keyword"] = get_content_title_keywords(id=answer.id, content_type="answer")
# item["has_service"] = has_service(tag_ids, content_keyword) # item["has_service"] = has_service(tag_ids, content_keyword)
item["has_service"] =False item["has_service"] = False
item['operators_add_tags'] = get_tag_v3_operators_tags(content_id=answer.id, content_type="answer") item['operators_add_tags'] = get_tag_v3_operators_tags(content_id=answer.id, content_type="answer")
item['anecdote_tags'] = get_tag_v3_anecdote_tags(content_id=answer.id, content_type="answer") item['anecdote_tags'] = get_tag_v3_anecdote_tags(content_id=answer.id, content_type="answer")
item['anecdote_tag_ids'] = get_tag_v3_anecdote_tag_ids(content_id=answer.id, content_type="answer") item['anecdote_tag_ids'] = get_tag_v3_anecdote_tag_ids(content_id=answer.id, content_type="answer")
...@@ -171,7 +172,7 @@ def get_answers(pks): ...@@ -171,7 +172,7 @@ def get_answers(pks):
item["is_need_guarantee"] = True item["is_need_guarantee"] = True
# else: # 7天以上强制不保量 # else: # 7天以上强制不保量
# item["is_need_guarantee"] = False # item["is_need_guarantee"] = False
item["has_video"]=Answer.has_video(answer) item["has_video"] = Answer.has_video(answer)
data.append(item) data.append(item)
except (Answer.DoesNotExist, Question.DoesNotExist): except (Answer.DoesNotExist, Question.DoesNotExist):
pass pass
......
...@@ -111,7 +111,7 @@ def has_service(tag_list, content_keyword): ...@@ -111,7 +111,7 @@ def has_service(tag_list, content_keyword):
{"terms": {"closure_tags": content_keyword}}], {"terms": {"closure_tags": content_keyword}}],
"minimum_should_match": 1}} "minimum_should_match": 1}}
res = es_query("service", q, 0, 1) res = es_query(doc="service", body=q, offset=0, size=1)
if res: if res:
if res['hits']['total'] > 0: if res['hits']['total'] > 0:
return True return True
......
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