From 93f8813c018cbdc81d41dbefc565b56115da6e95 Mon Sep 17 00:00:00 2001 From: ahao Date: Thu, 13 Mar 2025 10:27:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/user_order.py | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/backend/app/routers/user_order.py b/backend/app/routers/user_order.py index 39203f2..24e8ddd 100644 --- a/backend/app/routers/user_order.py +++ b/backend/app/routers/user_order.py @@ -297,28 +297,28 @@ async def wxpay_notify(request: Request): # 获取数据库连接 - connection = get_connection() - cursor = connection.cursor(dictionary=True) - - # 查询订单并锁定 - cursor.execute(""" - SELECT order_id, payable_price - FROM orders - WHERE out_trade_no = %s - FOR UPDATE""", (out_trade_no,)) - order = cursor.fetchone() - - cursor.execute(""" - UPDATE orders SET - order_status = 'completed', - payment_method = 'wechat', - wx_transaction_id = %s, - settlement_time = NOW() - WHERE order_id = %s""", - (transaction_id, order['order_id'])) - - - connection.commit() + # connection = get_connection() + # cursor = connection.cursor(dictionary=True) + # + # # 查询订单并锁定 + # cursor.execute(""" + # SELECT order_id, payable_price + # FROM orders + # WHERE out_trade_no = %s + # FOR UPDATE""", (out_trade_no,)) + # order = cursor.fetchone() + # + # cursor.execute(""" + # UPDATE orders SET + # order_status = 'completed', + # payment_method = 'wechat', + # wx_transaction_id = %s, + # settlement_time = NOW() + # WHERE order_id = %s""", + # (transaction_id, order['order_id'])) + # + # + # connection.commit() # 返回微信要求的成功响应 return JSONResponse(content={"code": "SUCCESS", "message": "OK"})