Commit 1d6a9cfb authored by 段英荣's avatar 段英荣

modify

parent fb98ca41
...@@ -40,11 +40,11 @@ def home_recommend(session_id="",user_id=-1,offset=0,size=10): ...@@ -40,11 +40,11 @@ def home_recommend(session_id="",user_id=-1,offset=0,size=10):
# 未登录用户已读帖子 # 未登录用户已读帖子
unregister_user_have_redis_topic_id_dict = dict() unregister_user_have_redis_topic_id_dict = dict()
if len(redis_val_dict)>0 and offset>0 and offset==last_offset_num: if len(redis_val_dict)>0 and offset>0:
if user_id>0: if user_id>0 and offset==last_offset_num:
topic_id_list = json.loads(redis_val_dict[b"unread_topic_id"]) + topic_id_list topic_id_list = json.loads(redis_val_dict[b"unread_topic_id"]) + topic_id_list
have_read_topic_id_set = set(json.loads(redis_val_dict[b"have_read_topic_id"])) have_read_topic_id_set = set(json.loads(redis_val_dict[b"have_read_topic_id"]))
else: elif user_id==-1:
unregister_user_have_redis_topic_id_dict = json.loads(redis_val_dict[b"have_read_topic_id"]) unregister_user_have_redis_topic_id_dict = json.loads(redis_val_dict[b"have_read_topic_id"])
for page_id in unregister_user_have_redis_topic_id_dict: for page_id in unregister_user_have_redis_topic_id_dict:
if int(page_id)<offset: if int(page_id)<offset:
...@@ -167,11 +167,11 @@ def home_query(session_id="",user_id=-1,query="",offset=0,size=10): ...@@ -167,11 +167,11 @@ def home_query(session_id="",user_id=-1,query="",offset=0,size=10):
# 未登录用户已读帖子 # 未登录用户已读帖子
unregister_user_have_redis_topic_id_dict = dict() unregister_user_have_redis_topic_id_dict = dict()
if len(redis_val_dict)>0 and offset>0 and offset==last_offset_num: if len(redis_val_dict)>0 and offset>0:
if user_id>0: if user_id>0 and offset==last_offset_num:
topic_id_list = json.loads(redis_val_dict[b"unread_topic_id"]) + topic_id_list topic_id_list = json.loads(redis_val_dict[b"unread_topic_id"]) + topic_id_list
have_read_topic_id_set = set(json.loads(redis_val_dict[b"have_read_topic_id"])) have_read_topic_id_set = set(json.loads(redis_val_dict[b"have_read_topic_id"]))
else: elif user_id==-1:
unregister_user_have_redis_topic_id_dict = json.loads(redis_val_dict[b"have_read_topic_id"]) unregister_user_have_redis_topic_id_dict = json.loads(redis_val_dict[b"have_read_topic_id"])
for page_id in unregister_user_have_redis_topic_id_dict: for page_id in unregister_user_have_redis_topic_id_dict:
if int(page_id)<offset: if int(page_id)<offset:
......
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