This commit is contained in:
ping 2025-12-09 15:06:54 +08:00
parent 2fa5c432f8
commit 827a9fcd7e

View File

@ -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,