From e754065a5dcda4ad7e9c4a5538b66b97e24c28bc Mon Sep 17 00:00:00 2001 From: richboo111 Date: Thu, 4 Aug 2022 11:46:43 +0800 Subject: [PATCH] pay --- business/jxstore/financial/financial.go | 7 +++++++ business/q_bida/q_bida_server.go | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/business/jxstore/financial/financial.go b/business/jxstore/financial/financial.go index e4f2b1162..ea4306005 100644 --- a/business/jxstore/financial/financial.go +++ b/business/jxstore/financial/financial.go @@ -282,10 +282,17 @@ func onTLpayFinished(call *tonglianpayapi.CallBackResult) (err error) { } }() globals.SugarLogger.Debug("更新order") + order.TransactionID = call.TrxID + globals.SugarLogger.Debug("输出赋值后的order.TransactionID", order.TransactionID) if _, err := dao.UpdateEntityTx(txdb, order); err != nil { dao.Rollback(db, txdb) return err } + //测试order 数据库是否更新成功 + order_test, err := dao.GetOrderByID(db, order.OrderID) + globals.SugarLogger.Debug("再次从数据库拿order.TransactionID", order_test.TransactionID) + //、、、、、、、、、、、、、、 + globals.SugarLogger.Debug("获取UserVendorOrder") userOrder := model.UserVendorOrder{LocalWayBill: order.OrderID} if err := dao.GetEntity(db, &userOrder, "LocalWayBill"); err != nil { diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index e3d891a25..f0a648c2d 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -294,11 +294,14 @@ func CancelWayOrder(ctx *jxcontext.Context, userId string, param *bida.CancelOrd if err != nil { return FailCode, err } - userBill.AccountBalance += mixPayInfo.BalancePrice + //userBill.AccountBalance = mixPayInfo.BalancePrice globals.SugarLogger.Debug("回调输出userBill.AccountBalance", userBill.AccountBalance) - if _, err := dao.UpdateEntity(db, userBill, "AccountBalance"); err != nil { - return FailCode, err + if err := dao.UpdateUserBill(userBill.UserID, mixPayInfo.BalancePrice); err != nil { + return 0, err } + //if _, err := dao.UpdateEntity(db, userBill, "AccountBalance"); err != nil { + // return FailCode, err + //} //更新mixPay 状态 mixPayInfo.Status = -1 //model.BillMixPayRefund1 //退款状态 if _, err := dao.UpdateEntity(db, mixPayInfo, "Status"); err != nil {