Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tour_business
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
魏强
tour_business
Commits
419e84bb
Commit
419e84bb
authored
Aug 03, 2020
by
Aeolus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
租借记录返回总单数
parent
9ea795a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Controller/ReportController.py
+3
-2
Service/ReportService.py
+2
-1
No files found.
Controller/ReportController.py
View file @
419e84bb
...
@@ -117,5 +117,6 @@ def rent_over_record():
...
@@ -117,5 +117,6 @@ def rent_over_record():
if
int
(
data_type
)
not
in
[
1
,
2
]:
if
int
(
data_type
)
not
in
[
1
,
2
]:
return
jsonify
(
BASE_RESPONSE
(
error_code
=-
1
,
error_message
=
'type error'
)
.
to_dict
())
return
jsonify
(
BASE_RESPONSE
(
error_code
=-
1
,
error_message
=
'type error'
)
.
to_dict
())
total
,
data
=
ReportService
.
get_spot_rent_record
(
spot_id
,
int
(
data_type
),
date
,
page
,
limit
)
total
,
total_rent
,
data
=
ReportService
.
get_spot_rent_record
(
spot_id
,
int
(
data_type
),
date
,
page
,
limit
)
return
jsonify
({
'error_code'
:
200
,
'error_message'
:
'Success'
,
'total'
:
total
,
'data'
:
data
})
return
jsonify
(
{
'error_code'
:
200
,
'error_message'
:
'Success'
,
'total'
:
total
,
'total_rent'
:
total_rent
,
'data'
:
data
})
Service/ReportService.py
View file @
419e84bb
...
@@ -231,6 +231,7 @@ class ReportService():
...
@@ -231,6 +231,7 @@ class ReportService():
where
.
add
(
Rent
.
created_at
<=
date
+
last_date
)
where
.
add
(
Rent
.
created_at
<=
date
+
last_date
)
income
,
total
=
IndexService
.
get_total_production
(
spot_id
,
date
+
'-01 00:00:00'
,
date
+
last_date
)
income
,
total
=
IndexService
.
get_total_production
(
spot_id
,
date
+
'-01 00:00:00'
,
date
+
last_date
)
total_rent
=
rent_info
=
Rent
.
query
.
filter
(
*
where
)
.
count
()
rent_info
=
Rent
.
query
.
filter
(
*
where
)
.
order_by
(
Rent
.
created_at
.
desc
())
.
slice
(
page
*
limit
,
rent_info
=
Rent
.
query
.
filter
(
*
where
)
.
order_by
(
Rent
.
created_at
.
desc
())
.
slice
(
page
*
limit
,
(
page
+
1
)
*
limit
)
.
all
()
(
page
+
1
)
*
limit
)
.
all
()
data
=
[]
data
=
[]
...
@@ -242,4 +243,4 @@ class ReportService():
...
@@ -242,4 +243,4 @@ class ReportService():
}
}
data
.
append
(
tmp
)
data
.
append
(
tmp
)
return
income
,
data
return
income
,
total_rent
,
data
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