Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inspect_report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
zhengjinlei
inspect_report
Commits
04441033
Commit
04441033
authored
Dec 12, 2019
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页统计
parent
a3fa669b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
tasksapi.py
src/inspect_report/api/tasksapi.py
+4
-1
No files found.
src/inspect_report/api/tasksapi.py
View file @
04441033
...
@@ -560,7 +560,10 @@ class TasksApi(viewsets.ViewSet):
...
@@ -560,7 +560,10 @@ class TasksApi(viewsets.ViewSet):
task_condition
=
{
'create_date__gte'
:
q_start_date
,
'create_date__lt'
:
q_end_date
}
task_condition
=
{
'create_date__gte'
:
q_start_date
,
'create_date__lt'
:
q_end_date
}
if
task_id
:
if
task_id
:
task_condition
[
'task'
]
=
task_id
task_condition
[
'task'
]
=
task_id
tasks
=
RulesStat
.
objects
.
filter
(
**
task_condition
)
.
values
(
'rule'
,
'sessionCollectionId'
,
'rule_num'
)
# tasks = RulesStat.objects.filter(**task_condition).values('rule', 'sessionCollectionId', 'rule_num')
tasks
=
RulesStat
.
objects
.
all
()
.
filter
(
**
task_condition
)
\
.
extra
(
select
=
{
'rule'
:
"rule"
,
'sessionCollectionId'
:
'sessionCollectionId'
})
\
.
values
(
'rule'
,
'sessionCollectionId'
)
.
annotate
(
rule_num
=
Count
(
'id'
))
.
order_by
(
'-rule_num'
)
for
t
in
tasks
:
for
t
in
tasks
:
name
=
t
[
'rule'
]
name
=
t
[
'rule'
]
if
name
in
return_data
.
keys
():
if
name
in
return_data
.
keys
():
...
...
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