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
1cac125a
Commit
1cac125a
authored
Jun 28, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步数据
parent
c2f61e2c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
topic.py
trans2es/models/topic.py
+14
-5
No files found.
trans2es/models/topic.py
View file @
1cac125a
...
@@ -277,12 +277,21 @@ class Topic(models.Model):
...
@@ -277,12 +277,21 @@ class Topic(models.Model):
related_billboard_list
=
list
()
related_billboard_list
=
list
()
query_results
=
TopicBillBoard
.
objects
.
filter
(
pictorial_id__in
=
pictorial_ids
)
for
pictorial_id
in
pictorial_ids
:
for
items
in
query_results
:
query_result
=
TopicBillBoard
.
objects
.
filter
(
pictorial_id
=
pictorial_id
,
total_vote_cnt
=
int
(
items
.
virt_vote_cnt
)
+
int
(
items
.
real_vote_cnt
)
topic_id
=
self
.
id
)
.
values
()
.
first
()
related_billboard_list
.
append
({
"pictorial_id"
:
items
.
pictorial_id
,
"real_vote_cnt"
:
items
.
real_vote_cnt
,
"virt_vote_cnt"
:
items
.
virt_vote_cnt
,
"total_vote_cnt"
:
total_vote_cnt
})
if
query_result
==
None
:
related_billboard_list
.
append
({
"pictorial_id"
:
pictorial_id
,
"real_vote_cnt"
:
0
,
"virt_vote_cnt"
:
0
,
"total_vote_cnt"
:
0
})
else
:
total_vote_cnt
=
int
(
query_result
[
"virt_vote_cnt"
])
+
int
(
query_result
[
"real_vote_cnt"
])
related_billboard_list
.
append
(
{
"pictorial_id"
:
query_result
[
"pictorial_id"
],
"real_vote_cnt"
:
query_result
[
"real_vote_cnt"
],
"virt_vote_cnt"
:
query_result
[
"virt_vote_cnt"
],
"total_vote_cnt"
:
total_vote_cnt
})
logging
.
info
(
"product_brand_info"
%
related_billboard_list
)
logging
.
info
(
"product_brand_info"
%
related_billboard_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