Commit a59246d5 authored by 段英荣's avatar 段英荣

Merge branch 'dev' into 'master'

modify

See merge request !46
parents f255d79d 65615bbe
......@@ -77,7 +77,7 @@ class GroupUtils(object):
return []
@classmethod
def get_user_attention_group_list(cls,user_id,offset,size):
def get_user_attention_group_list(cls,user_id,offset=0,size=10):
"""
:remark: 获取用户关注小组列表
:return:
......
......@@ -52,14 +52,14 @@ def group_sort(user_id=-1,sort_type=GroupSortTypes.HOT_RECOMMEND,offset=0,size=1
return {"group_recommend_ids":group_ids_list}
elif sort_type==GroupSortTypes.ATTENTION_RECOMMEND:
attention_group_list = GroupUtils.get_user_attention_group_list(user_id,offset,size)
attention_group_list = GroupUtils.get_user_attention_group_list(user_id,offset=0,size=1)
if len(attention_group_list)==0:
return {"group_recommend_ids": []}
else:
attention_group_id_list = [item["group_id"] for item in attention_group_list]
sorted_group_ids_list = GroupUtils.get_group_ids_by_aggs(attention_group_id_list)
group_recommend_ids_list = sorted_group_ids_list
group_recommend_ids_list = sorted_group_ids_list[offset:(offset+size)]
if len(group_recommend_ids_list) < size and len(group_recommend_ids_list)<len(attention_group_list):
sorted_attention_group_list = sorted(attention_group_list,key=lambda item:item["update_time_val"],reverse=True)
for item in sorted_attention_group_list:
......
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