From 6f6916ee91cbff1684c041112b150d1b7c88715c Mon Sep 17 00:00:00 2001 From: jianweie code Date: Thu, 1 Feb 2024 01:29:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=9B=A2=E9=92=88?= =?UTF-8?q?=E5=AF=B9=E5=90=8C=E4=B8=80=E4=B8=AA=E5=95=86=E5=93=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A4=9A=E4=B8=AA=E6=8B=BC=E5=9B=A2=E8=A7=84=E5=88=99?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=87=91=E9=A2=9D=E8=AE=A1=E7=AE=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pintuan/ICoreCmsPintuanRuleRepository.cs | 3 ++- .../Pintuan/ICoreCmsPintuanRuleServices.cs | 3 ++- .../Pintuan/CoreCmsPintuanRuleRepository.cs | 6 ++++-- CoreCms.Net.Services/Cart/CoreCmsCartServices.cs | 4 ++-- CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs | 5 +++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs b/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs index 07e656e0..0ca8773f 100644 --- a/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs +++ b/CoreCms.Net.IRepository/Pintuan/ICoreCmsPintuanRuleRepository.cs @@ -30,8 +30,9 @@ namespace CoreCms.Net.IRepository /// 取购物车数据的时候,更新价格 /// /// + /// 规则序列 /// - WebApiCallBack PinTuanInfo(List list); + WebApiCallBack PinTuanInfo(List list, int ruleId); /// diff --git a/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs b/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs index 1195bb9c..10da2a99 100644 --- a/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs +++ b/CoreCms.Net.IServices/Pintuan/ICoreCmsPintuanRuleServices.cs @@ -30,8 +30,9 @@ namespace CoreCms.Net.IServices /// 取购物车数据的时候,更新价格 /// /// + /// 规则序列 /// - WebApiCallBack PinTuanInfo(List list); + WebApiCallBack PinTuanInfo(List list, int ruleId); /// diff --git a/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs b/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs index 4c95b149..6e4b9207 100644 --- a/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs +++ b/CoreCms.Net.Repository/Pintuan/CoreCmsPintuanRuleRepository.cs @@ -35,12 +35,14 @@ namespace CoreCms.Net.Repository } #region 取购物车数据的时候,更新价格 + /// /// 取购物车数据的时候,更新价格 /// /// + /// 规则序列 /// - public WebApiCallBack PinTuanInfo(List list) + public WebApiCallBack PinTuanInfo(List list, int ruleId) { var res = new WebApiCallBack(); foreach (var item in list) @@ -50,7 +52,7 @@ namespace CoreCms.Net.Repository { JoinType.Inner, pinTuanGoods.ruleId == pinTuanRule.id }).Where((pinTuanGoods, pinTuanRule) => - pinTuanGoods.goodsId == item.products.goodsId && pinTuanRule.isStatusOpen == true) + pinTuanGoods.goodsId == item.products.goodsId && pinTuanRule.isStatusOpen == true && pinTuanRule.id == ruleId) .Select((pinTuanGoods, pinTuanRule) => pinTuanRule).First(); if (ruleModel == null) { diff --git a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs index 591268d0..fe7a9845 100644 --- a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs +++ b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs @@ -495,7 +495,7 @@ namespace CoreCms.Net.Services cartProducts.isSelect = false; } //判断商品是否已收藏 - cartProducts.isCollection = await _goodsCollectionServices.Check(userId, (int)cartProducts.products.goodsId); + cartProducts.isCollection = await _goodsCollectionServices.Check(userId, cartProducts.products.goodsId); cartDto.list.Add(cartProducts); } @@ -507,7 +507,7 @@ namespace CoreCms.Net.Services break; case (int)GlobalEnumVars.OrderType.PinTuan: //拼团模式走拼团价,去修改商品价格 - var result = _pinTuanRuleServices.PinTuanInfo(cartDto.list); + var result = _pinTuanRuleServices.PinTuanInfo(cartDto.list, objectId); if (result.status) { cartDto.list = result.data as List; diff --git a/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs b/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs index a51ed146..00030f9c 100644 --- a/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs +++ b/CoreCms.Net.Services/Pintuan/CoreCmsPintuanRuleServices.cs @@ -56,10 +56,11 @@ namespace CoreCms.Net.Services /// 取购物车数据的时候,更新价格 /// /// + /// 规则序列 /// - public WebApiCallBack PinTuanInfo(List list) + public WebApiCallBack PinTuanInfo(List list, int ruleId) { - return _dal.PinTuanInfo(list); + return _dal.PinTuanInfo(list,ruleId); }