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
99463756
Commit
99463756
authored
Mar 30, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化财务修复时间
parent
4291f70d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
schemas.py
app/api/account/schemas.py
+1
-1
crud.py
app/api/statement/crud.py
+2
-11
functions.py
libs/functions.py
+6
-0
No files found.
app/api/account/schemas.py
View file @
99463756
...
...
@@ -48,7 +48,7 @@ class FixTable(BaseModel):
type
:
int
uuid
:
str
money
:
float
amount_type
:
str
=
""
amount_type
:
str
=
"
consumable
"
remark
:
str
...
...
app/api/statement/crud.py
View file @
99463756
...
...
@@ -13,7 +13,7 @@ from core.config.env import env
from
libs.db_link
import
LinkMysql
from
core.config.env
import
env
from
libs.db_link
import
LinkMysql
from
libs.functions
import
time_str_to_timestamp
from
libs.functions
import
time_str_to_timestamp
,
timestamp_to_time_str
from
libs.orm
import
QueryAllData
from
models.recharge
import
Recharge
,
UserWC
,
GuildWC
,
FinanceFixLog
...
...
@@ -355,17 +355,8 @@ class FinanceFix(object):
result
=
[]
for
i
in
res
:
if
i
[
'type'
]
!=
0
:
# user_sql = f"select nick_name from v2_user where uuid='{i['unique_tag']}' limit 0,1"
# v2_user_res = LinkMysql(env.DB_3YV2).query_mysql(user_sql)
# if not v2_user_res:
# guild_sql = f"select guild_name as name from guild where uuid='{i['unique_tag']}' limit 0,1"
# guild_res = LinkMysql(env.DB_3YV2).query_mysql(guild_sql)
# if not guild_res:
# i['name'] = i['unique_tag']
# i['name'] = guild_res[0]['guild_name']
# continue
# i['name'] = v2_user_res[0]['nick_name']
i
[
'name'
]
=
i
[
'unique_tag'
]
i
[
'create_time'
]
=
timestamp_to_time_str
(
i
[
'create_time'
])
result
.
append
(
i
)
return
result
,
total
[
0
][
'num'
]
return
[],
0
libs/functions.py
View file @
99463756
...
...
@@ -52,6 +52,12 @@ def time_str_to_timestamp(time_str):
return
int
(
time
.
mktime
(
time_array
))
def
timestamp_to_time_str
(
time_stamp
):
"""时间戳类型转 时间字符串类型"""
time_array
=
time
.
localtime
(
time_stamp
)
return
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
time_array
)
def
md5
(
s
):
"""md5加密"""
sign_str
=
hashlib
.
md5
()
...
...
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