From 827a9fcd7e49786b48850ca892a16fdee9676315 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Tue, 9 Dec 2025 15:06:54 +0800 Subject: [PATCH] update --- b/baiduc/baidu_confirm_refund_order.dspy | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/b/baiduc/baidu_confirm_refund_order.dspy b/b/baiduc/baidu_confirm_refund_order.dspy index 46245ca..fb13695 100644 --- a/b/baiduc/baidu_confirm_refund_order.dspy +++ b/b/baiduc/baidu_confirm_refund_order.dspy @@ -51,9 +51,9 @@ async def affirmbz_order(ns={}): count = await getCustomerBalance(sor, orgid[0]['customerid']) if count == None: count = 0 - if count - float(orgid[0]['amount']) < 0: - pricedifference = count - round(orgid[0]['amount'],2) - return {'status': False, 'msg': '账户余额不足','pricedifference': round(pricedifference,2)} + #if count - float(orgid[0]['amount']) < 0: + #pricedifference = count - round(orgid[0]['amount'],2) + #return {'status': False, 'msg': '账户余额不足, count: %s' % str(count),'pricedifference': round(pricedifference,2)} await order2bill(ns['orderid'], sor) bills = await sor.R('bill', {'orderid': ns['orderid'], 'del_flg': '0'}) try: @@ -902,15 +902,17 @@ async def baidu_confirm_refund_order(ns={}): await sor.U('user_action', {'id': ns_record_id, 'ordertype': 'REFUND', 'reason': '远程退款成功, 本地客户退款成功'}) continue else: - ns_err_log = { - 'id': uuid(), - 'log_level': 'ERROR', - 'log_content': '远程退款成功,本地退款失败 %s' % str(local_refund_status), - 'user_id': ns.get('userid'), - 'request_url': '/baiduc//baidu_confirm_refund_order.dspy', - 'request_params': json.dumps({'order_id': order_id, 'baidu_id': ns.get('baidu_id')}), - } - await sor.C('warn_error_log', ns_err_log) + db = DBPools() + async with db.sqlorContext('kboss') as sor: + ns_err_log = { + 'id': uuid(), + 'log_level': 'ERROR', + 'log_content': '远程退款成功,本地退款失败 %s' % str(local_refund_status), + 'user_id': ns.get('userid'), + 'request_url': '/baiduc//baidu_confirm_refund_order.dspy', + 'request_params': json.dumps({'order_id': order_id, 'baidu_id': ns.get('baidu_id')}), + } + await sor.C('warn_error_log', ns_err_log) ns_record = { 'orderid': order_id,