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
3d257f19
Commit
3d257f19
authored
Jul 23, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
榜单活动帖子
parent
cbdca49c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
group.py
search/views/group.py
+25
-1
No files found.
search/views/group.py
View file @
3d257f19
...
@@ -396,7 +396,6 @@ def pictorial_activity_sort(activity_id=0, offset=0, size=10, sort_type=1):
...
@@ -396,7 +396,6 @@ def pictorial_activity_sort(activity_id=0, offset=0, size=10, sort_type=1):
q
[
"sort"
]
=
process_sort
(
sort_type
)
q
[
"sort"
]
=
process_sort
(
sort_type
)
es_cli_obj
=
ESPerform
.
get_cli
()
es_cli_obj
=
ESPerform
.
get_cli
()
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"pictorial"
,
q
,
offset
,
size
)
result_dict
=
ESPerform
.
get_search_results
(
es_cli_obj
,
"pictorial"
,
q
,
offset
,
size
)
if
len
(
result_dict
[
"hits"
])
>
0
:
if
len
(
result_dict
[
"hits"
])
>
0
:
for
item
in
result_dict
[
"hits"
]:
for
item
in
result_dict
[
"hits"
]:
pictorial_id
=
item
[
"_source"
][
"id"
]
pictorial_id
=
item
[
"_source"
][
"id"
]
...
@@ -503,3 +502,28 @@ def pictorial_topic_sort_peoplehot(pictorial_id=-1, user_id=-1, offset=0, size=1
...
@@ -503,3 +502,28 @@ def pictorial_topic_sort_peoplehot(pictorial_id=-1, user_id=-1, offset=0, size=1
except
:
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"pict_pictorial_ids_list"
:
[]}
return
{
"pict_pictorial_ids_list"
:
[]}
@bind
(
"physical/search/pictorial_activity_topic"
)
def
get_pictorial_activeity_topic_sort
(
activity_id
=
0
,
topic_id
=
0
):
try
:
pictorial_activity_topic_sort
=
[]
pictorial_ids_list
=
pictorial_activity_sort
(
activity_id
=
activity_id
,
size
=
999
,
offset
=
0
,
sort_type
=
1
)
logging
.
info
(
"get pictorial_ids_list:
%
s"
%
pictorial_ids_list
)
data
=
pictorial_ids_list
.
get
(
"pictorial_activity_sort"
,
[])
logging
.
info
(
"get data:
%
s"
%
data
)
if
data
:
pictorial_id
=
[]
for
item
in
data
:
pictorial_id
.
append
(
item
[
"pictorial_id"
])
if
topic_id
in
pictorial_id
:
topic_sort
=
pictorial_id
.
index
(
topic_id
)
pictorial_activity_topic_sort
.
append
({
"topic"
:
topic_id
,
"topic_sort"
:
topic_sort
+
1
})
else
:
pictorial_activity_topic_sort
.
append
({
"topic"
:
topic_id
,
"topic_sort"
:
1000
})
return
{
"pictorial_activity_topic_sort"
:
pictorial_activity_topic_sort
}
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"pictorial_activity_topic_sort"
:
[]}
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