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
9d355ce3
Commit
9d355ce3
authored
May 09, 2020
by
lvshibao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加get获取参数
parent
bb0e2d82
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
dbhelper.py
src/inspect_report/dbhelper.py
+21
-21
No files found.
src/inspect_report/dbhelper.py
View file @
9d355ce3
...
...
@@ -39,14 +39,14 @@ def get_city_country_team():
def
db_static_score
(
req
):
city_id
=
req
.
data
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
city_id
=
req
.
data
.
get
(
'city'
,
None
)
if
'city'
in
req
.
data
else
req
.
GET
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
if
'country'
in
req
.
data
else
req
.
GET
.
get
(
'country'
,
None
)
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
team_names
=
get_team_names
(
city_id
,
country_id
)
task_condition
[
'task__in'
]
=
team_names
sort
=
req
.
data
.
get
(
'sort'
,
'-avg_score'
)
sort
=
req
.
data
.
get
(
'sort'
,
'-avg_score'
)
if
'sort'
in
req
.
data
else
req
.
GET
.
get
(
'sort'
,
None
)
all_scores
=
ScoreStat
.
objects
.
filter
(
**
task_condition
)
.
extra
(
select
=
{
'area'
:
"task"
})
.
values
(
'area'
)
.
annotate
(
avg_score_svc
=
Round
(
Avg
(
'service_score'
),
2
),
avg_score_bus
=
Round
(
Avg
(
'business_score'
),
2
),
...
...
@@ -56,11 +56,11 @@ def db_static_score(req):
def
db_seat_rule
(
req
,
if_page
=
False
):
city_id
=
req
.
data
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
agent_name
=
req
.
data
.
get
(
'seat'
,
''
)
sort
=
req
.
data
.
get
(
'sort'
,
'des'
)
city_id
=
req
.
data
.
get
(
'city'
,
None
)
if
'city'
in
req
.
data
else
req
.
GET
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
if
'country'
in
req
.
data
else
req
.
GET
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
if
'team'
in
req
.
data
else
req
.
GET
.
get
(
'team'
,
None
)
agent_name
=
req
.
data
.
get
(
'seat'
,
''
)
if
'seat'
in
req
.
data
else
req
.
GET
.
get
(
'team'
,
''
)
sort
=
req
.
data
.
get
(
'sort'
,
'des'
)
if
'sort'
in
req
.
data
else
req
.
GET
.
get
(
'sort'
,
'des'
)
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
team_names
=
get_team_names
(
city_id
,
country_id
,
team_id
)
...
...
@@ -119,10 +119,10 @@ def db_seat_rule(req, if_page=False):
def
db_seat_check
(
req
,
if_page
=
False
):
city_id
=
req
.
data
.
get
(
'city'
,
''
)
country_id
=
req
.
data
.
get
(
'country'
,
''
)
team_id
=
req
.
data
.
get
(
'team'
,
''
)
agent_name
=
req
.
data
.
get
(
'agentName'
,
''
)
city_id
=
req
.
data
.
get
(
'city'
,
''
)
if
'city'
in
req
.
data
else
req
.
GET
.
get
(
'city'
,
''
)
country_id
=
req
.
data
.
get
(
'country'
,
''
)
if
'country'
in
req
.
data
else
req
.
GET
.
get
(
'country'
,
''
)
team_id
=
req
.
data
.
get
(
'team'
,
''
)
if
'team'
in
req
.
data
else
req
.
GET
.
get
(
'team'
,
''
)
agent_name
=
req
.
data
.
get
(
'agentName'
,
''
)
if
'agentName'
in
req
.
data
else
req
.
GET
.
get
(
'agentName'
,
''
)
task_condition
=
req
.
data
.
get
(
'at_condition'
,
{})
task_condition
[
'hasCheck'
]
=
1
...
...
@@ -210,12 +210,12 @@ def db_seat_check(req, if_page=False):
def
db_seat_area
(
req
):
city_id
=
req
.
data
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
agent_name
=
req
.
data
.
get
(
'seat'
,
''
)
sort
=
req
.
data
.
get
(
'sort'
,
'-avg_score'
)
task_condition
=
req
.
data
.
get
(
'date_condition'
,
''
)
city_id
=
req
.
data
.
get
(
'city'
,
None
)
if
'city'
in
req
.
data
else
req
.
GET
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
if
'country'
in
req
.
data
else
req
.
GET
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
if
'team'
in
req
.
data
else
req
.
GET
.
get
(
'team'
,
None
)
agent_name
=
req
.
data
.
get
(
'seat'
,
''
)
if
'seat'
in
req
.
data
else
req
.
GET
.
get
(
'seat'
,
''
)
sort
=
req
.
data
.
get
(
'sort'
,
'-avg_score'
)
if
'sort'
in
req
.
data
else
req
.
GET
.
get
(
'sort'
,
'-avg_score'
)
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{}
)
team_names
=
get_team_names
(
city_id
,
country_id
,
team_id
)
...
...
@@ -235,9 +235,9 @@ def db_seat_area(req):
def
db_static_rule
(
req
):
city_id
=
req
.
data
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
city_id
=
req
.
data
.
get
(
'city'
,
None
)
if
'city_id'
in
req
.
data
else
req
.
GET
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
if
'country'
in
req
.
data
else
req
.
GET
.
get
(
'country'
,
None
)
team_id
=
req
.
data
.
get
(
'team'
,
None
)
if
'team'
in
req
.
data
else
req
.
GET
.
get
(
'team'
,
None
)
team_names
=
get_team_names
(
city_id
,
country_id
,
team_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