运费减免逻辑修改

This commit is contained in:
richboo111
2022-08-22 10:20:47 +08:00
parent 4eb9a1a1c2
commit b49200b69b

View File

@@ -1019,7 +1019,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 = outJxOrder.FreightPrice - int64(discountPrice[0].DeliveryFeeDeductionFee)
if outJxOrder.FreightPrice-int64(discountPrice[0].DeliveryFeeDeductionFee) >= 0 {
outJxOrder.FreightPrice = outJxOrder.FreightPrice - int64(discountPrice[0].DeliveryFeeDeductionFee)
} else {
outJxOrder.FreightPrice = 0
}
}
// ?????????????????????? 测试
if storeDetail.ID == 668470 || storeDetail.ID == 668469 {
@@ -1720,7 +1724,7 @@ func CancelPayTimeOutOrder(ctx *jxcontext.Context) (err error) {
AND vendor_id = ?
`
sqlParams := []interface{}{
time.Now().Add(-time.Minute * 1),
time.Now().Add(-time.Minute * 30),
model.OrderStatusWait4Pay,
model.VendorIDJX,
}