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
de23b162
Commit
de23b162
authored
Mar 30, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化转账金额不足问题
parent
82395212
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
guild.py
app/api/statement/guild.py
+6
-2
No files found.
app/api/statement/guild.py
View file @
de23b162
...
@@ -264,6 +264,10 @@ def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用
...
@@ -264,6 +264,10 @@ def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用
"notify_url"
:
""
"notify_url"
:
""
}
}
res
=
search
(
request_data
,
'Server.UserExecute.Transfer'
)
res
=
search
(
request_data
,
'Server.UserExecute.Transfer'
)
if
not
res
[
'data'
][
'result'
][
'status'
]:
if
'Insufficient assets'
in
res
[
'data'
][
'result'
][
'msg'
]:
return
"资产不足,无法转账"
return
res
[
'data'
][
'result'
][
'msg'
]
print
(
res
)
print
(
res
)
status
=
2
status
=
2
if
res
[
'status'
]
==
0
:
if
res
[
'status'
]
==
0
:
...
@@ -272,7 +276,7 @@ def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用
...
@@ -272,7 +276,7 @@ def transfer_trigger_task(uuid, user_id, balance, type, amount_type, remark='用
add_sql
=
f
"insert into all_record_table(user_id, type, status, reference_number, remark, money, is_add, money_data,create_time,amount_type) "
\
add_sql
=
f
"insert into all_record_table(user_id, type, status, reference_number, remark, money, is_add, money_data,create_time,amount_type) "
\
f
"values({user_id}, '{type}', {status},'{get_order()}','{remark}', {balance * 10 if amount_type == 1 else balance * 100},1,'{json.dumps(money_data)}',{get_now_timestamp()},{amount_type});"
f
"values({user_id}, '{type}', {status},'{get_order()}','{remark}', {balance * 10 if amount_type == 1 else balance * 100},1,'{json.dumps(money_data)}',{get_now_timestamp()},{amount_type});"
LinkMysql
(
env
.
DB_3YV2
)
.
perform_mysql
(
add_sql
)
LinkMysql
(
env
.
DB_3YV2
)
.
perform_mysql
(
add_sql
)
return
res
return
''
def
transfer_money
(
db
:
Session
,
param
,
h_list
):
def
transfer_money
(
db
:
Session
,
param
,
h_list
):
...
@@ -309,7 +313,7 @@ def transfer_money(db: Session, param, h_list):
...
@@ -309,7 +313,7 @@ def transfer_money(db: Session, param, h_list):
# 转账
# 转账
is_success
=
transfer_trigger_task
(
param
.
dst_id
,
0
,
param
.
amount
,
'platformRecharge'
,
amount_type
,
is_success
=
transfer_trigger_task
(
param
.
dst_id
,
0
,
param
.
amount
,
'platformRecharge'
,
amount_type
,
f
"{param.dst_id}给{param.transfer_id}转账"
,
[],
0
,
param
.
transfer_id
)
f
"{param.dst_id}给{param.transfer_id}转账"
,
[],
0
,
param
.
transfer_id
)
if
not
is_success
[
'status'
]
:
if
is_success
:
return
is_success
return
is_success
user
=
query_token
(
db
,
h_list
)
user
=
query_token
(
db
,
h_list
)
transfer_sql
=
f
"insert into fi_transfer_log(amount, dst_name, create_time, transfer_uuid, dst_uuid, user_id, remarks, operator,operator_id) "
\
transfer_sql
=
f
"insert into fi_transfer_log(amount, dst_name, create_time, transfer_uuid, dst_uuid, user_id, remarks, operator,operator_id) "
\
...
...
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