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
fd455d63
Commit
fd455d63
authored
Apr 12, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化充值列表
parent
9084b13a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
crud.py
app/api/statement/crud.py
+3
-3
views.py
app/api/statement/views.py
+1
-1
functions.py
libs/functions.py
+27
-0
No files found.
app/api/statement/crud.py
View file @
fd455d63
...
@@ -19,7 +19,7 @@ from core.config.env import env
...
@@ -19,7 +19,7 @@ from core.config.env import env
from
libs.db_link
import
LinkMysql
from
libs.db_link
import
LinkMysql
from
core.config.env
import
env
from
core.config.env
import
env
from
libs.db_link
import
LinkMysql
from
libs.db_link
import
LinkMysql
from
libs.functions
import
time_str_to_timestamp
,
timestamp_to_time_str
,
get_month_last_month
from
libs.functions
import
time_str_to_timestamp
,
timestamp_to_time_str
,
get_month_last_month
,
get_date_list
from
libs.orm
import
QueryAllData
from
libs.orm
import
QueryAllData
from
models.recharge
import
Recharge
,
UserWC
,
GuildWC
,
FinanceFixLog
from
models.recharge
import
Recharge
,
UserWC
,
GuildWC
,
FinanceFixLog
from
models.menuconfig
import
Menuconfig
from
models.menuconfig
import
Menuconfig
...
@@ -93,8 +93,8 @@ class RechargeStatement(object):
...
@@ -93,8 +93,8 @@ class RechargeStatement(object):
if
end_time
:
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
)
query
=
' and '
.
join
(
query
)
now_month
=
get_
month_last_month
(
month_typ
e
)
now_month
=
get_
date_list
(
start_time
,
end_tim
e
)
count
,
once_res
,
moeny_data
=
self
.
statistics_data
(
month_type
,
query
,
page
,
size
,
now_month
[
1
])
count
,
once_res
,
moeny_data
=
self
.
statistics_data
(
month_type
,
query
,
page
,
size
,
now_month
[
0
])
else
:
else
:
query_data
=
self
.
query_add_time
(
start_time
,
end_time
,
query
)
query_data
=
self
.
query_add_time
(
start_time
,
end_time
,
query
)
count
,
once_res
,
moeny_data
=
self
.
thread_data
(
month_type
,
query_data
,
page
,
size
)
count
,
once_res
,
moeny_data
=
self
.
thread_data
(
month_type
,
query_data
,
page
,
size
)
...
...
app/api/statement/views.py
View file @
fd455d63
...
@@ -36,7 +36,7 @@ def statement_derive_excel(request:Request,data: schemas.StatementList,db: Sessi
...
@@ -36,7 +36,7 @@ def statement_derive_excel(request:Request,data: schemas.StatementList,db: Sessi
total
,
statement_list
,
money
=
RechargeStatement
()
.
query_data
(
db
,
data
.
page
,
data
.
size
,
data
.
order_number
,
data
.
uuid
,
total
,
statement_list
,
money
=
RechargeStatement
()
.
query_data
(
db
,
data
.
page
,
data
.
size
,
data
.
order_number
,
data
.
uuid
,
data
.
sid
,
data
.
start_time
,
data
.
end_time
,
data
.
types
,
data
.
sid
,
data
.
start_time
,
data
.
end_time
,
data
.
types
,
data
.
menu_id
,
data
.
month_type
)
data
.
menu_id
,
data
.
month_type
)
field_list
=
[
"uuid"
,
"充值金额(元)"
,
"支付时间"
,
"类型"
,
"订单号"
]
field_list
=
[
"
id"
,
"
uuid"
,
"充值金额(元)"
,
"支付时间"
,
"类型"
,
"订单号"
]
return
crud
.
data_to_file
(
db
,
statement_list
,
"充值报表"
,
header_list
,
field_list
)
return
crud
.
data_to_file
(
db
,
statement_list
,
"充值报表"
,
header_list
,
field_list
)
...
...
libs/functions.py
View file @
fd455d63
...
@@ -149,3 +149,30 @@ def query_guild_info(guild_uuid):
...
@@ -149,3 +149,30 @@ def query_guild_info(guild_uuid):
url
=
"http://106.55.103.148:8787/api/userInfo/getGuildInfo"
url
=
"http://106.55.103.148:8787/api/userInfo/getGuildInfo"
result
=
requests
.
post
(
url
=
url
,
json
=
{
"uuid"
:
guild_uuid
})
result
=
requests
.
post
(
url
=
url
,
json
=
{
"uuid"
:
guild_uuid
})
return
result
return
result
def
gen_dates
(
b_date
,
days
):
"""
日期生成器
:param b_date: 开始时间
:param days: 天数
:return:
"""
day
=
timedelta
(
days
=
1
)
for
i
in
range
(
days
):
yield
b_date
+
day
*
i
def
get_date_list
(
start
,
end
):
"""
获取n天前日期列表
:param n: 几天前
:return:
"""
data
=
[]
start_time
=
datetime
.
strptime
(
start
,
"
%
Y-
%
m-
%
d"
)
end_time
=
datetime
.
strptime
(
end
,
"
%
Y-
%
m-
%
d"
)
for
ym
in
gen_dates
(
start_time
,
(
end_time
-
start_time
)
.
days
):
year_month
=
ym
.
strftime
(
'
%
Y
%
m'
)
data
.
append
(
year_month
)
return
tuple
(
set
(
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