From 1cb49b04ae6709e6054c328f5ed12bff9ca014c8 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期二, 12 十一月 2024 09:21:57 +0800
Subject: [PATCH] no message
---
CoreCms.Net.Web.WebApi/Controllers/CartController.cs | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/CoreCms.Net.Web.WebApi/Controllers/CartController.cs b/CoreCms.Net.Web.WebApi/Controllers/CartController.cs
index c176bbe..41a3bb0 100644
--- a/CoreCms.Net.Web.WebApi/Controllers/CartController.cs
+++ b/CoreCms.Net.Web.WebApi/Controllers/CartController.cs
@@ -1,7 +1,7 @@
锘�/***********************************************************************
- * Project: CoreCms
+ * Project: baifenBinfa
* ProjectName: 鐧惧垎鍏垫硶绠$悊绯荤粺
- * Web: hhtp://chuanyin.com
+ * Web: http://chuanyin.com
* Author:
* Email:
* CreateTime: 202403/02
@@ -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,7 +59,20 @@
[Authorize]
public async Task<WebApiCallBack> AddCart([FromBody] FMCartAdd entity)
{
- var jm = await _cartServices.Add(_user.ID, entity.ProductId, entity.Nums, entity.type, entity.cartType, entity.objectId);
+
+ 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;
}
@@ -73,9 +89,8 @@
public async Task<WebApiCallBack> GetList([FromBody] FMCartGetList entity)
{
var ids = CommonHelper.StringToIntArray(entity.ids);
-
//鑾峰彇鏁版嵁
- var jm = await _cartServices.GetCartInfos(_user.ID, ids, entity.type, entity.areaId, entity.point, entity.couponCode, entity.receiptType, entity.userShipId, entity.objectId);
+ var jm = await _cartServices.GetCartInfos(_user.ID, ids, entity.type, entity.areaId, entity.point, entity.couponCode, entity.receiptType, entity.userShipId, entity.objectId, entity.goodsId);
return jm;
}
--
Gitblit v1.9.1