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
9899ea77
Commit
9899ea77
authored
Oct 31, 2019
by
zwild
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
topic detail order
parent
76dd662e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
collect_data.py
linucb/views/collect_data.py
+4
-7
group.py
search/views/group.py
+2
-2
No files found.
linucb/views/collect_data.py
View file @
9899ea77
# -*- coding: UTF-8 -*-
# !/usr/bin/env python
from
kafka
import
KafkaConsumer
import
random
from
libs.cache
import
redis_client
...
...
@@ -633,7 +630,7 @@ class CollectData(object):
logging
.
info
(
"action=api/v1/cards/topic"
)
tag_name
=
data
[
"APP"
]
.
get
(
"query"
,
[])
tag_list
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
name
=
tag_name
)
.
values_list
(
"id"
))
name
=
tag_name
)
.
values_list
(
"id"
,
flat
=
True
))
device_id
=
data
[
"SYS"
][
"cl_id"
]
user_id
=
data
[
'SYS'
]
.
get
(
'user_id'
,
None
)
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
...
...
@@ -651,7 +648,7 @@ class CollectData(object):
tag_ids
=
list
(
data
[
"APP"
]
.
get
(
"tag_ids"
,
[]))
tag_list
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
id__in
=
tag_ids
,
is_online
=
True
,
is_deleted
=
False
,
is_category
=
False
)
.
values_list
(
"id"
))
is_category
=
False
)
.
values_list
(
"id"
,
flat
=
True
))
device_id
=
data
[
"SYS"
][
"cl_id"
]
user_id
=
data
[
'SYS'
]
.
get
(
'user_id'
,
None
)
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
...
...
@@ -668,7 +665,7 @@ class CollectData(object):
tag_ids
=
list
(
data
[
"APP"
]
.
get
(
"tag_ids"
,
[]))
tag_list
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
id__in
=
tag_ids
,
is_online
=
True
,
is_deleted
=
False
,
is_category
=
False
)
.
values_list
(
"id"
))
is_category
=
False
)
.
values_list
(
"id"
,
flat
=
True
))
device_id
=
data
[
"SYS"
][
"cl_id"
]
user_id
=
data
[
'SYS'
]
.
get
(
'user_id'
,
None
)
self
.
transfer_update_recommend_tag_list
(
device_id
,
user_feature
,
user_id
,
...
...
@@ -685,7 +682,7 @@ class CollectData(object):
logging
.
info
(
'action:
%
s,tag_list:
%
s'
%
(
action
,
str
(
tag_ids
)))
tag_query_results
=
list
(
Tag
.
objects
.
using
(
settings
.
SLAVE1_DB_NAME
)
.
filter
(
id__in
=
tag_ids
,
is_online
=
True
,
is_deleted
=
False
,
is_category
=
False
)
.
values_list
(
"id"
))
is_category
=
False
)
.
values_list
(
"id"
,
flat
=
True
))
tag_query_results
=
[
i
[
0
]
for
i
in
tag_query_results
]
logging
.
info
(
'action:
%
s,mysql query taglist:
%
s'
%
(
action
,
str
(
tag_query_results
)))
tag_query_results_multi
=
[
i
for
i
in
tag_ids
if
i
in
tag_query_results
]
...
...
search/views/group.py
View file @
9899ea77
...
...
@@ -359,7 +359,7 @@ def pictorial_topic_sort(pictorial_id=-1, offset=0, size=10, sort_type=PICTORIAL
if
sort_type
==
PICTORIAL_TOPIC_SORT
.
HOT
:
q
[
"sort"
]
=
[
{
"related_billboard.
tot
al_vote_cnt"
:
{
{
"related_billboard.
re
al_vote_cnt"
:
{
"order"
:
"desc"
,
"nested_path"
:
"related_billboard"
,
"missing"
:
"_last"
,
...
...
@@ -403,7 +403,7 @@ def pictorial_topic_sort(pictorial_id=-1, offset=0, size=10, sort_type=PICTORIAL
# }}
# ]
q
[
"sort"
]
=
[
{
"related_billboard.
tot
al_vote_cnt"
:
{
{
"related_billboard.
re
al_vote_cnt"
:
{
"order"
:
"desc"
,
"nested_path"
:
"related_billboard"
,
"missing"
:
"_last"
,
...
...
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