Commit 92ce6546 authored by lixiaofang's avatar lixiaofang

add

parent 3d257f19
......@@ -504,26 +504,25 @@ def pictorial_topic_sort_peoplehot(pictorial_id=-1, user_id=-1, offset=0, size=1
return {"pict_pictorial_ids_list": []}
@bind("physical/search/pictorial_activity_topic")
def get_pictorial_activeity_topic_sort(activity_id=0, topic_id=0):
@bind("physical/search/pictorial_activity_sort")
def get_pictorial_activeity_sort(activity_id=0, pictorial_id=0):
try:
pictorial_activity_topic_sort = []
pictorial_activity_sort_only = []
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 = []
pictorial_ids = []
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})
pictorial_ids.append(item["pictorial_id"])
if pictorial_id in pictorial_ids:
pictorial_sort = pictorial_ids.index(pictorial_id)
pictorial_activity_sort_only.append({"pictorial_id": pictorial_id, "pictorial_sort": pictorial_sort + 1})
else:
pictorial_activity_topic_sort.append({"topic": topic_id, "topic_sort": 1000})
return {"pictorial_activity_topic_sort": pictorial_activity_topic_sort}
pictorial_activity_sort_only.append({"pictorial_id": pictorial_id, "pictorial_sort": 1000})
return {"pictorial_activity_sort": pictorial_activity_sort_only}
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return {"pictorial_activity_topic_sort": []}
return {"pictorial_activity_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