Commit 3d257f19 authored by lixiaofang's avatar lixiaofang

榜单活动帖子

parent cbdca49c
...@@ -396,7 +396,6 @@ def pictorial_activity_sort(activity_id=0, offset=0, size=10, sort_type=1): ...@@ -396,7 +396,6 @@ def pictorial_activity_sort(activity_id=0, offset=0, size=10, sort_type=1):
q["sort"] = process_sort(sort_type) q["sort"] = process_sort(sort_type)
es_cli_obj = ESPerform.get_cli() es_cli_obj = ESPerform.get_cli()
result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, size) result_dict = ESPerform.get_search_results(es_cli_obj, "pictorial", q, offset, size)
if len(result_dict["hits"]) > 0: if len(result_dict["hits"]) > 0:
for item in result_dict["hits"]: for item in result_dict["hits"]:
pictorial_id = item["_source"]["id"] pictorial_id = item["_source"]["id"]
...@@ -503,3 +502,28 @@ def pictorial_topic_sort_peoplehot(pictorial_id=-1, user_id=-1, offset=0, size=1 ...@@ -503,3 +502,28 @@ def pictorial_topic_sort_peoplehot(pictorial_id=-1, user_id=-1, offset=0, size=1
except: except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"pict_pictorial_ids_list": []} return {"pict_pictorial_ids_list": []}
@bind("physical/search/pictorial_activity_topic")
def get_pictorial_activeity_topic_sort(activity_id=0, topic_id=0):
try:
pictorial_activity_topic_sort = []
pictorial_ids_list = pictorial_activity_sort(activity_id=activity_id, size=999, offset=0, sort_type=1)
logging.info("get pictorial_ids_list:%s" % pictorial_ids_list)
data = pictorial_ids_list.get("pictorial_activity_sort", [])
logging.info("get data:%s" % data)
if data:
pictorial_id = []
for item in data:
pictorial_id.append(item["pictorial_id"])
if topic_id in pictorial_id:
topic_sort = pictorial_id.index(topic_id)
pictorial_activity_topic_sort.append({"topic": topic_id, "topic_sort": topic_sort + 1})
else:
pictorial_activity_topic_sort.append({"topic": topic_id, "topic_sort": 1000})
return {"pictorial_activity_topic_sort": pictorial_activity_topic_sort}
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"pictorial_activity_topic_sort": []}
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