From 62ee680e20f9f4de16bd995add9c76b543262c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Wed, 7 Dec 2022 01:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=90=E5=85=A8=E5=B1=80=E4=BF=83=E9=94=80=E3=80=91?= =?UTF-8?q?=E3=80=90=E5=9B=A2=E8=B4=AD=E7=A7=92=E6=9D=80=E3=80=91=E3=80=90?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E3=80=91=E6=B7=BB=E5=8A=A0=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E7=BB=93=E6=9E=9C=E7=9A=84=E6=8F=90=E9=86=92=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreCms.Net.Configuration/GlobalErrorCodeVars.cs | 3 +++ .../Promotion/CoreCmsPromotionController.cs | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) 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; + } } //返回数据