移动系统liao
2024-06-17 e98303dc5e2ce122c8788189183c7600b11a2f5c
no message
2个文件已修改
29 ■■■■■ 已修改文件
CoreCms.Net.Services/Shop/CoreCmsPagesServices.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CoreCms.Net.Web.WebApi/Controllers/CartController.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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"))
                            {
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;
        }