Commit 2de1926e authored by 段英荣's avatar 段英荣

增加搜索次数>=7的限制

parent 526d7efd
......@@ -178,11 +178,13 @@ class QueryWordAttr(object):
def get_search_query_results_num(cls, name):
try:
total_num = 0
data = StrategyHistoryQueryWords.objects.filter(keyword=name).values("answer_num",
data = StrategyHistoryQueryWords.objects.filter(keyword=name,search_num__lte=7).values("answer_num",
"tractate_num",
"diary_num").first()
for value in data.values():
total_num += value
if data:
for value in data.values():
total_num += value
return total_num
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......
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