This commit is contained in:
邹宗楠
2023-05-19 18:26:23 +08:00
parent 7c7def7436
commit 20cda2be44
4 changed files with 31 additions and 9 deletions

View File

@@ -324,7 +324,7 @@ func Pay4Order(ctx *jxcontext.Context, orderID int64, payType int, vendorPayType
//if subAppID == tiktok.TiktokAppId || subAppID == tiktok.TiktokJXDJAppID {
// subAppID = model.JXC4AppId // 京西商城
//}
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID); err == nil && orderPay != nil {
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID, ""); err == nil && orderPay != nil {
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
@@ -351,7 +351,7 @@ func Pay4Order(ctx *jxcontext.Context, orderID int64, payType int, vendorPayType
ActualPayPrice: priceDefendOrders[0].ActualPayPrice,
VendorID: model.VendorIDJX,
}
if orderPay, err = pay4OrderByTL(ctx, order2, payType, vendorPayType, subAppID); err == nil && orderPay != nil {
if orderPay, err = pay4OrderByTL(ctx, order2, payType, vendorPayType, subAppID, ""); err == nil && orderPay != nil {
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
@@ -359,7 +359,7 @@ func Pay4Order(ctx *jxcontext.Context, orderID int64, payType int, vendorPayType
return orderPay, err
}
func Pay4User(ctx *jxcontext.Context, thingID int, vendorOrderID string, payType int, vendorPayType, subAppID string) (orderPay *model.OrderPay, err error) {
func Pay4User(ctx *jxcontext.Context, thingID int, vendorOrderID string, payType int, vendorPayType, subAppID, code string) (orderPay *model.OrderPay, err error) {
var (
db = dao.GetDB()
order *model.GoodsOrder
@@ -383,7 +383,7 @@ func Pay4User(ctx *jxcontext.Context, thingID int, vendorOrderID string, payType
ActualPayPrice: int64(discountCard.Price),
VendorID: model.VendorIDJX,
}
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID); err == nil && orderPay != nil {
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID, code); err == nil && orderPay != nil {
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
@@ -416,7 +416,7 @@ func Pay4User(ctx *jxcontext.Context, thingID int, vendorOrderID string, payType
ActualPayPrice: int64(storeOrder.ActualPayPrice),
VendorID: model.VendorIDJX,
}
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID); err == nil && orderPay != nil {
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID, code); err == nil && orderPay != nil {
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
@@ -431,7 +431,7 @@ func Pay4User(ctx *jxcontext.Context, thingID int, vendorOrderID string, payType
ActualPayPrice: int64(brandOrder.ActualPayPrice),
VendorID: model.VendorIDJX,
}
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID); err == nil && orderPay != nil {
if orderPay, err = pay4OrderByTL(ctx, order, payType, vendorPayType, subAppID, code); err == nil && orderPay != nil {
dao.WrapAddIDCULDEntity(orderPay, ctx.GetUserName())
err = dao.CreateEntity(dao.GetDB(), orderPay)
}
@@ -841,7 +841,7 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
if jxOrder.OrderType != model.OrderTypeMatter || (jxOrder.OrderType == model.OrderTypeMatter && fromStoreID == -1) {
outJxOrder.Skus = append(outJxOrder.Skus, jxSku)
outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice
} else { //以下else为物料订单袋子金额和数量处理
} else { //以下else为物料订单袋子金额和数量处理
if !result.Flag { //只要flag是false就按原价申请是true再按订单量
outJxOrder.Skus = append(outJxOrder.Skus, jxSku)
outJxOrder.OrderPrice += int64(jxSku.Count) * jxSku.SalePrice