From e98303dc5e2ce122c8788189183c7600b11a2f5c Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期一, 17 六月 2024 13:34:47 +0800
Subject: [PATCH] no message
---
CoreCms.Net.Web.WebApi/Controllers/CartController.cs | 18 +++++++++++++++++-
CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs | 11 ++++++++++-
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs
index c8c2147..903a804 100644
--- a/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs
+++ b/CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs
@@ -58,6 +58,7 @@
private readonly IHttpContextUser _contextUser;
private readonly IBfbfComAPIService _bfbfComAPIService;
private readonly IUnitOfWork _unitOfWork;
+
public CoreCmsPagesServices(IUnitOfWork unitOfWork
, ICoreCmsPagesRepository dal
, ICoreCmsPagesItemsRepository pagesItemsRepository,
@@ -582,6 +583,10 @@
break;
case "groupPurchase":
{
+ //鍥㈣喘 鍙栨秷
+ bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID);
+ if (isDic)
+ continue;
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
if (parameters != null && parameters.ContainsKey("list"))
{
@@ -614,7 +619,7 @@
break;
}
case "seckill":
- {
+ {//绉掓潃
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
if (parameters != null && parameters.ContainsKey("list"))
{
@@ -650,6 +655,10 @@
break;
case "pinTuan":
{
+ //鎷煎洟
+ bool isDic = await _bfbfComAPIService.IsDictionary(_contextUser.ID);
+ if (isDic)
+ continue;
var parameters = (JObject)JsonConvert.DeserializeObject(item.parameters);
if (parameters != null && parameters.ContainsKey("list"))
{
diff --git a/CoreCms.Net.Web.WebApi/Controllers/CartController.cs b/CoreCms.Net.Web.WebApi/Controllers/CartController.cs
index ebca83a..450ff96 100644
--- a/CoreCms.Net.Web.WebApi/Controllers/CartController.cs
+++ b/CoreCms.Net.Web.WebApi/Controllers/CartController.cs
@@ -18,6 +18,7 @@
using CoreCms.Net.Configuration;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Model.ViewModels.UI;
+using CoreCms.Net.IServices.baifenbingfa;
namespace CoreCms.Net.Web.WebApi.Controllers
{
@@ -30,15 +31,17 @@
{
private readonly IHttpContextUser _user;
private readonly ICoreCmsCartServices _cartServices;
+ private readonly IBfbfComAPIService _bfbfComAPIService;
/// <summary>
/// 鏋勯�犲嚱鏁�
/// </summary>
- public CartController(IHttpContextUser user, ICoreCmsCartServices cartServices)
+ public CartController(IHttpContextUser user, ICoreCmsCartServices cartServices,IBfbfComAPIService bfbfComAPIService)
{
_user = user;
_cartServices = cartServices;
+ _bfbfComAPIService = bfbfComAPIService;
}
//鍏叡鎺ュ彛====================================================================================================
@@ -56,6 +59,19 @@
[Authorize]
public async Task<WebApiCallBack> AddCart([FromBody] FMCartAdd entity)
{
+
+ if ((await _bfbfComAPIService.IsDictionary(_user.ID)) && (entity.cartType != 1||entity.cartType!=4))//1鏄櫘閫氬崟锛�4 鏄鏉�
+ {
+ //缁忛攢鍟嗚繘鍒跺彂璧峰洟璐�
+ return new WebApiCallBack
+ {
+ status = false,
+ msg = " 瀵逛笉璧� 缁忛攢鍟嗕笉鍙互鍙戣捣鍥㈣喘鎴栬�呮嫾鍥�"
+
+ };
+ }
+
+
var jm = await _cartServices.Add(_user.ID, entity.ProductId, entity.Nums, entity.type, entity.cartType, entity.objectId,entity.isCustomizable);
return jm;
}
--
Gitblit v1.9.1