diff --git a/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs b/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs index d94d0023..b3407ded 100644 --- a/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs +++ b/CoreCms.Net.Services/Promotion/CoreCmsPromotionServices.cs @@ -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); diff --git a/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs b/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs index a5f87823..04c6d1a4 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs @@ -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 }; //查询筛选