This commit is contained in:
ping 2025-09-22 11:43:21 +08:00
parent 81655628c2
commit 80821599ea

View File

@ -1,6 +1,7 @@
async def user_action_record(ns={}): async def user_action_record(ns={}):
ns_dic_id = uuid() if not ns.get('id') else ns.get('id')
ns_dic = { ns_dic = {
'id': uuid(), 'id': ns_dic_id,
'source': '百度智能云', 'source': '百度智能云',
'orderid': ns.get('orderid'), 'orderid': ns.get('orderid'),
'ordertype': ns.get('ordertype'), 'ordertype': ns.get('ordertype'),
@ -225,9 +226,10 @@ async def baidu_confirm_refund_order(ns={}):
if data_ == {'success': True}: if data_ == {'success': True}:
# if True: # if True:
ns_record = { ns_record = {
'id': uuid(),
'orderid': ns.get('order_id'), 'orderid': ns.get('order_id'),
'ordertype': 'REFUND', 'ordertype': 'REFUND',
'userid': ns.get('userid'), 'userid': ns.get('user_id'),
'reason': '远程退款成功' 'reason': '远程退款成功'
} }
await user_action_record(ns_record) await user_action_record(ns_record)
@ -264,6 +266,7 @@ async def baidu_confirm_refund_order(ns={}):
db = DBPools() db = DBPools()
async with db.sqlorContext('kboss') as sor: async with db.sqlorContext('kboss') as sor:
await sor.U('baidu_orders', {'id': refund_id, 'refundstatus': '2'}) await sor.U('baidu_orders', {'id': refund_id, 'refundstatus': '2'})
await sor.U('user_action', {'id': ns_record.get('id'), 'ordertype': 'REFUND', 'reason': '远程退款成功, 本地客户退款成功'})
return { return {
'status': True, 'status': True,