diff --git a/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs b/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs index 29dbbdf6..50fe3f2c 100644 --- a/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs +++ b/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs @@ -415,6 +415,9 @@ namespace CoreCms.Net.Configuration public const string Code15026 = "该优惠券已被其他人领取"; public const string Code15027 = "绑定失败"; public const string Code15028 = "优惠券超过最大领取数量"; + public const string Code15029 = "全局促销只能有一种促销结果"; + public const string Code15030 = "优化全只能有一种促销结果"; + //拼团 public const string Code15600 = "活动已结束"; diff --git a/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs b/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs index 04c6d1a4..09ac7426 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Promotion/CoreCmsPromotionController.cs @@ -849,8 +849,20 @@ namespace CoreCms.Net.Web.Admin.Controllers var resultCount = await _coreCmsPromotionResultServices.GetCountAsync(p => p.promotionId == entity.id); if (resultCount >= 1) { - jm.msg = GlobalErrorCodeVars.Code15016; - return jm; + if (model.type == (int)GlobalEnumVars.PromotionType.Promotion) + { + jm.msg = GlobalErrorCodeVars.Code15029; + return jm; + } + else if (model.type == (int)GlobalEnumVars.PromotionType.Group || model.type == (int)GlobalEnumVars.PromotionType.Seckill) + { + jm.msg = GlobalErrorCodeVars.Code15016; + return jm; + } else if (model.type == (int)GlobalEnumVars.PromotionType.Coupon) + { + jm.msg = GlobalErrorCodeVars.Code15030; + return jm; + } } //返回数据