fix: 更新尊享包折扣规则为每10元减2.5元,最多减50元,并同步修改提示文案
This commit is contained in:
@@ -218,11 +218,11 @@ public class PayService : ApplicationService, IPayService
|
||||
|
||||
if (discountAmount > 0)
|
||||
{
|
||||
discountDescription = $"已优惠 ¥{discountAmount:F2}(累计充值每10元减1元,最多减20元)";
|
||||
discountDescription = $"已优惠 ¥{discountAmount:F2}(累计充值每10元减2.5元,最多减50元)";
|
||||
}
|
||||
else
|
||||
{
|
||||
discountDescription = "累计充值每10元可减1元,最多减20元";
|
||||
discountDescription = "累计充值每10元可减2.5元,最多减50元";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ public static class GoodsTypeEnumExtensions
|
||||
|
||||
/// <summary>
|
||||
/// 计算折扣金额(仅用于尊享包)
|
||||
/// 规则:每累加充值10元,减少1元,最多减少20元
|
||||
/// 规则:每累加充值10元,减少2.5元,最多减少50元
|
||||
/// </summary>
|
||||
/// <param name="goodsType">商品类型</param>
|
||||
/// <param name="totalRechargeAmount">用户累加充值金额</param>
|
||||
@@ -240,11 +240,11 @@ public static class GoodsTypeEnumExtensions
|
||||
return 0m;
|
||||
}
|
||||
|
||||
// 每10元减1元
|
||||
var discountAmount = Math.Floor(totalRechargeAmount / 10m);
|
||||
// 每10元减2.5元
|
||||
var discountAmount = Math.Floor(totalRechargeAmount / 2.5m);
|
||||
|
||||
// 最多减少20元
|
||||
return Math.Min(discountAmount, 20m);
|
||||
// 最多减少50元
|
||||
return Math.Min(discountAmount, 50m);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user