diff --git a/business/jxstore/cms/order.go b/business/jxstore/cms/order.go index b91599b19..ef992563b 100644 --- a/business/jxstore/cms/order.go +++ b/business/jxstore/cms/order.go @@ -127,17 +127,19 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType, app globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.OrderID, order.PayPrice, order.PayMethod) globals.SugarLogger.Debug("经过更新操作后的数据after=========================", order.PayPrice) globals.SugarLogger.Debugf("pay begin……") - //err = dao.GetEntity(db, order, "OrderID") - //if order.OrderID == "" { - // return result, fmt.Errorf("未找到此订单!") - //} - - info, err := dao.GetOrderByID(db, orderID) - if err != nil { - return nil, err + err = dao.GetEntity(db, order, "OrderID") + if order.OrderID == "" { + return result, fmt.Errorf("未找到此订单!") } - globals.SugarLogger.Debug("Order再次从数据库获得order详情", info.PayPrice, info.PayMethod) - payHandler.Order = info + + //info, err := dao.GetOrderByID(db, orderID) + //if err != nil { + // return nil, err + //} + globals.SugarLogger.Debug("Order再次从数据库获得order详情", order.PayPrice, order.PayMethod) + //globals.SugarLogger.Debug("Order再次从数据库获得order详情", info.PayPrice, info.PayMethod) + payHandler.Order = order + //payHandler.Order = info globals.SugarLogger.Debug("payHandler.Order再次从数据库获得order详情", payHandler.Order.PayPrice, payHandler.Order.PayMethod) //如果用户没有对应账单信息就给他生成一条 diff --git a/business/jxstore/financial/financial.go b/business/jxstore/financial/financial.go index ea4306005..546185b1e 100644 --- a/business/jxstore/financial/financial.go +++ b/business/jxstore/financial/financial.go @@ -284,14 +284,14 @@ 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 { + if _, err := dao.UpdateEntityTx(txdb, order, "TransactionID"); 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}