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
钟尚武
physical
Commits
11b1d7b6
Commit
11b1d7b6
authored
Apr 29, 2019
by
黄凯
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hk' into 'test'
revise history data See merge request alpha/physical!309
parents
4e6d1d70
af32cc9d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
topic.py
search/views/topic.py
+4
-2
No files found.
search/views/topic.py
View file @
11b1d7b6
...
...
@@ -87,7 +87,7 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
recommend_topic_dict
=
redis_client
.
hgetall
(
topic_recommend_redis_key
)
if
b
"data"
in
recommend_topic_dict
:
recommend_topic_id_list
=
json
.
loads
(
recommend_topic_dict
[
b
"data"
])
recommend_topic_id_dict
=
json
.
loads
(
recommend_topic_dict
[
b
"datadict"
])
# 推荐帖子是强插的,要保证推荐帖子不在已读里
recommend_topic_id_list
=
list
(
set
(
recommend_topic_id_list
)
-
set
(
have_read_topic_id_list
))
...
...
@@ -98,8 +98,10 @@ def get_home_recommend_topic_ids(user_id, device_id, tag_id, offset, size, query
redis_client
.
hset
(
topic_recommend_redis_key
,
"cursor"
,
newcursor
)
recommend_topic_user_list
=
list
()
if
b
"datadict"
in
recommend_topic_dict
:
recommend_topic_id_dict
=
json
.
loads
(
recommend_topic_dict
[
b
"datadict"
])
if
len
(
recommend_topic_list
)
==
6
:
for
i
in
recommend_topic_lis
t
:
for
i
in
recommend_topic_id_dic
t
:
recommend_topic_user_list
.
append
(
i
.
values
())
# 用户关注标签
redis_tag_data
=
redis_client
.
hget
(
"physical:linucb:register_user_tag_info"
,
user_id
)
...
...
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