Commit 9822021d authored by lixiaofang's avatar lixiaofang

add

parent 92ce6546
......@@ -404,7 +404,8 @@ def pictorial_activity_sort(activity_id=0, offset=0, size=10, sort_type=1):
redis_client.set(redis_key, json.dumps(pictorial_ids_list))
else:
redis_field_val_list = redis_client.get(redis_key)
pictorial_ids_list = json.loads(str(redis_field_val_list, encoding="utf-8"))
pictorial_ids_list_all = json.loads(str(redis_field_val_list, encoding="utf-8"))
pictorial_ids_list = pictorial_ids_list_all[offset:size + offset]
return {"pictorial_activity_sort": pictorial_ids_list}
......@@ -518,7 +519,8 @@ def get_pictorial_activeity_sort(activity_id=0, pictorial_id=0):
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})
pictorial_activity_sort_only.append(
{"pictorial_id": pictorial_id, "pictorial_sort": pictorial_sort + 1})
else:
pictorial_activity_sort_only.append({"pictorial_id": pictorial_id, "pictorial_sort": 1000})
return {"pictorial_activity_sort": pictorial_activity_sort_only}
......
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