【修复】修复订单金额满xx减,设置多种条件的情况下,参开启排他后,所有订单优惠金额无效的问题。

This commit is contained in:
大灰灰
2022-11-04 03:22:19 +08:00
parent 6e35ffb357
commit 9c96fb0538
2 changed files with 6 additions and 5 deletions

View File

@@ -88,8 +88,9 @@ namespace CoreCms.Net.Services
foreach (var item in promotions)
{
await SetPromotion(item, cart);
if (item.isExclusive == true) break;
//如果当前这个条件满足,并且它排他(意思就是它可以了,别的就不要来了。)
var isSatisfy = await SetPromotion(item, cart);
if (item.isExclusive == true && isSatisfy) break;
}
return cart;
@@ -160,7 +161,7 @@ namespace CoreCms.Net.Services
if (key)
{
//走到这一步就说明所有的促销条件都符合,那么就去计算结果
var promotionResults = await _promotionResultServices.QueryListByClauseAsync(p => p.promotionId == promotion.id);
var promotionResults = await _promotionResultServices.QueryListByClauseAsync(p => p.promotionId == promotion.id, p => p.id, OrderByType.Asc, true, true);
foreach (var item in promotionResults)
{
await _promotionResultServices.toResult(item, cartModel, promotion);

View File

@@ -113,7 +113,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
"isAutoReceive" => p => p.isAutoReceive,
"isEnable" => p => p.isEnable,
"isDel" => p => p.isDel,
_ => p => p.id
_ => p => p.sort
};
//设置排序方式
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
@@ -121,7 +121,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
{
"asc" => OrderByType.Asc,
"desc" => OrderByType.Desc,
_ => OrderByType.Desc
_ => OrderByType.Asc
};
//查询筛选