1
This commit is contained in:
@@ -236,12 +236,19 @@ func CreateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64,
|
||||
if jxOrder.OrderType == model.OrderTypeMatter {
|
||||
checkMatterDeliveryAddress(deliveryAddress)
|
||||
}
|
||||
globals.SugarLogger.Debug("outorder====",outJxOrder.TotalPrice,outJxOrder.FreightPrice)
|
||||
globals.SugarLogger.Debug("jxOrder=====",jxOrder.TotalPrice,jxOrder.FreightPrice)
|
||||
if createType == OrderCreateTypeNormal {
|
||||
if jxOrder.OrderType == model.OrderTypeDefendPrice && jxOrder.IsPriceDefend != model.YES {
|
||||
vendorOrderID := buildDefendPriceOrder(ctx, jxOrder, addressID)
|
||||
outJxOrder.OrderID = utils.Str2Int64(vendorOrderID)
|
||||
return outJxOrder, err
|
||||
}
|
||||
//discountPrice, err := cms.GetStoreVendorMaps(ctx, nil, jxOrder.StoreID, -1)
|
||||
//if err != nil {
|
||||
// return nil, err
|
||||
//}
|
||||
|
||||
if outJxOrder.TotalPrice != jxOrder.TotalPrice && jxOrder.IsPriceDefend != model.YES {
|
||||
return nil, fmt.Errorf("商品或配送信息发生改变,请重新下单")
|
||||
}
|
||||
@@ -1005,13 +1012,11 @@ func generateOrder(ctx *jxcontext.Context, jxOrder *JxOrderInfo, addressID int64
|
||||
discountPrice, err := cms.GetStoreVendorMaps(ctx, nil, jxOrder.StoreID, -1)
|
||||
if len(discountPrice) == 1 && outJxOrder.OrderPrice >= int64(discountPrice[0].DeliveryFeeDeductionSill) {
|
||||
outJxOrder.FreightPrice -= int64(discountPrice[0].DeliveryFeeDeductionFee)
|
||||
jxOrder.FreightPrice -= int64(discountPrice[0].DeliveryFeeDeductionFee)
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
if jxOrder.OrderType == model.OrderTypeNormal {
|
||||
outJxOrder.TotalPrice = outJxOrder.OrderPrice + outJxOrder.FreightPrice
|
||||
jxOrder.TotalPrice = jxOrder.OrderPrice + jxOrder.FreightPrice
|
||||
var (
|
||||
tuserID string
|
||||
dicountCards []*model.DiscountCard
|
||||
|
||||
Reference in New Issue
Block a user