Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
financial-system
Project
Project
Details
Activity
Releases
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
xianyang
financial-system
Commits
fc258a89
Commit
fc258a89
authored
Jul 12, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化2
parent
51aab31c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
crud.py
app/api/statement/crud.py
+4
-4
No files found.
app/api/statement/crud.py
View file @
fc258a89
...
...
@@ -167,7 +167,7 @@ class RechargeStatement(object):
def
query_sum_money
(
self
,
start_time
,
end_time
):
start_stamp
=
time_str_to_timestamp
(
start_time
+
' 00:00:00'
)
end_stamp
=
time_str_to_timestamp
(
end_time
+
' 23:59:59'
)
order_sql
=
f
"SELECT sum(money) as money FROM orders WHERE lastupdate>={start_stamp} and lastupdate<{end_stamp}"
order_sql
=
f
"SELECT sum(money) as money FROM orders WHERE
status =1 and
lastupdate>={start_stamp} and lastupdate<{end_stamp}"
order_res
=
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
(
order_sql
)
if
order_res
:
sum_money
=
order_res
[
0
][
'money'
]
...
...
@@ -208,7 +208,7 @@ class RechargeStatement(object):
if
start_time
:
query
.
append
(
f
" create_time >= {time_str_to_timestamp(start_time + ' 00:00:00')} "
)
if
end_time
:
query
.
append
(
f
" create_time < {time_str_to_timestamp(end_time + ' 23:59:59')} "
)
query
.
append
(
f
" create_time <
=
{time_str_to_timestamp(end_time + ' 23:59:59')} "
)
query
=
' and '
.
join
(
query
)
now_month
=
get_month_last_month
(
month_type
,
start_time
,
end_time
)
count
,
once_res
,
moeny_data
=
self
.
statistics_data
(
month_type
,
query
,
page
,
size
,
now_month
[
1
],
export_status
)
...
...
@@ -224,9 +224,9 @@ class RechargeStatement(object):
query
=
[]
query1
=
[]
query
.
append
(
f
" create_time >= {time_str_to_timestamp(start_time + ' 00:00:00')} "
)
query
.
append
(
f
" create_time < {time_str_to_timestamp(end_time + ' 23:59:59')} "
)
query
.
append
(
f
" create_time <
=
{time_str_to_timestamp(end_time + ' 23:59:59')} "
)
query1
.
append
(
f
" create_time >= {time_str_to_timestamp(start_time + ' 00:00:00')} "
)
query1
.
append
(
f
" create_time < {time_str_to_timestamp(end_time + ' 23:59:59')} "
)
query1
.
append
(
f
" create_time <
=
{time_str_to_timestamp(end_time + ' 23:59:59')} "
)
if
old_query
:
query
=
query
+
old_query
query1
=
query1
+
old_query
...
...
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