Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpha
physical
Commits
a59246d5
Commit
a59246d5
authored
Dec 17, 2018
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
modify See merge request
!46
parents
f255d79d
65615bbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
group.py
search/utils/group.py
+1
-1
group.py
search/views/group.py
+2
-2
No files found.
search/utils/group.py
View file @
a59246d5
...
...
@@ -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:
...
...
search/views/group.py
View file @
a59246d5
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment