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
ca9a8478
Commit
ca9a8478
authored
Apr 12, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化账户消费类型显示2
parent
48e06dc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
20 deletions
+31
-20
crud.py
app/api/account/crud.py
+31
-20
No files found.
app/api/account/crud.py
View file @
ca9a8478
...
...
@@ -118,26 +118,37 @@ class HDUd():
def
get_gift_type
(
unique_tag
):
"""礼物类型"""
fi_income_id
=
[]
fi_out_id
=
[]
fi_sql
=
f
"select income,output from fi_account where unique_tag='{unique_tag}'"
gift_sql
=
"select id,keyName,keyValue,type from fi_account_type"
with
ThreadPoolExecutor
(
max_workers
=
2
)
as
pool
:
future1
=
pool
.
submit
(
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
,
fi_sql
)
future2
=
pool
.
submit
(
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
,
gift_sql
)
account
=
future1
.
result
()
output
=
future2
.
result
()
if
account
[
0
]
.
get
(
'output'
):
fi_out_id
=
[
int
(
i
)
for
i
in
account
[
0
]
.
get
(
'output'
)
.
split
(
','
)]
if
account
[
0
]
.
get
(
'income'
):
fi_income_id
=
[
int
(
i
)
for
i
in
account
[
0
]
.
get
(
'income'
)
.
split
(
','
)]
out_list
=
[]
income_list
=
[]
for
info
in
output
:
if
info
.
get
(
"type"
)
==
1
and
info
.
get
(
"id"
)
in
fi_income_id
:
income_list
.
append
(
info
)
if
info
.
get
(
"type"
)
==
0
and
info
.
get
(
"id"
)
in
fi_out_id
:
out_list
.
append
(
info
)
if
unique_tag
:
fi_income_id
=
[]
fi_out_id
=
[]
fi_sql
=
f
"select income,output from fi_account where unique_tag='{unique_tag}'"
gift_sql
=
"select id,keyName,keyValue,type from fi_account_type"
with
ThreadPoolExecutor
(
max_workers
=
2
)
as
pool
:
future1
=
pool
.
submit
(
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
,
fi_sql
)
future2
=
pool
.
submit
(
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
,
gift_sql
)
account
=
future1
.
result
()
output
=
future2
.
result
()
if
account
[
0
]
.
get
(
'output'
):
fi_out_id
=
[
int
(
i
)
for
i
in
account
[
0
]
.
get
(
'output'
)
.
split
(
','
)]
if
account
[
0
]
.
get
(
'income'
):
fi_income_id
=
[
int
(
i
)
for
i
in
account
[
0
]
.
get
(
'income'
)
.
split
(
','
)]
out_list
=
[]
income_list
=
[]
for
info
in
output
:
if
info
.
get
(
"type"
)
==
1
and
info
.
get
(
"id"
)
in
fi_income_id
:
income_list
.
append
(
info
)
if
info
.
get
(
"type"
)
==
0
and
info
.
get
(
"id"
)
in
fi_out_id
:
out_list
.
append
(
info
)
else
:
out_list
=
[]
income_list
=
[]
gift_sql
=
"select id,keyName,keyValue,type from fi_account_type"
output
=
LinkMysql
(
env
.
DB_3YV2
)
.
query_mysql
(
gift_sql
)
for
info
in
output
:
if
info
.
get
(
"type"
)
==
1
:
income_list
.
append
(
info
)
else
:
out_list
.
append
(
info
)
return
{
"income"
:
income_list
,
"output"
:
out_list
}
...
...
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