| | |
| | | /*********************************************************************** |
| | | * Project: CoreCms |
| | | * Project: baifenBinfa |
| | | * ProjectName: 百分兵法管理系统 |
| | | * Web: hhtp://chuanyin.com |
| | | * Web: http://chuanyin.com |
| | | * Author: |
| | | * Email: |
| | | * CreateTime: 202403/02 |
| | |
| | | /// <param name="ids">已选择货号</param> |
| | | /// <param name="type">购物车类型/同订单类型</param> |
| | | /// <param name="objectId">关联非订单类型数据序列</param> |
| | | /// <param name="goodsId">goodsId</param> |
| | | /// <returns></returns> |
| | | public async Task<WebApiCallBack> GetCartDtoData(int userId, int[] ids = null, int type = 1, int objectId = 0) |
| | | public async Task<WebApiCallBack> GetCartDtoData(int userId, int[] ids = null, int type = 1, int objectId = 0, int goodsId = 0) |
| | | { |
| | | var jm = new WebApiCallBack() { methodDescription = "获取购物车原始列表(未核算)" }; |
| | | |
| | |
| | | { |
| | | carts = await _dal.QueryListByClauseAsync(p => p.userId == userId && p.type == type, p => p.id, OrderByType.Asc); |
| | | } |
| | | |
| | | if (goodsId>0) |
| | | { |
| | | var products = await _productsServices.GetProducts(goodsId); |
| | | int[] ss = products.Select(x => x.id).ToArray(); |
| | | |
| | | carts = carts.Where(p => ss.Contains(p.productId)).ToList(); |
| | | |
| | | } |
| | | |
| | | |
| | | var cartDto = new CartDto { userId = userId, type = type }; |
| | | |
| | | foreach (var item in carts) |
| | |
| | | /// <param name="userShipId">用户收货地址</param> |
| | | /// <param name="objectId">关联非普通订单营销类型序列</param> |
| | | /// <returns></returns> |
| | | public async Task<WebApiCallBack> GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point, string couponCode, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int userShipId = 0, int objectId = 0) |
| | | public async Task<WebApiCallBack> GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point, string couponCode, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int userShipId = 0, int objectId = 0, int goodsId = 0) |
| | | { |
| | | var jm = new WebApiCallBack() { methodDescription = "获取处理后的购物车信息" }; |
| | | var cartDto = new CartDto(); //必须初始化 |
| | | var cartDtoData = await GetCartDtoData(userId, ids, orderType, objectId); |
| | | var cartDtoData = await GetCartDtoData(userId, ids, orderType, objectId, goodsId); |
| | | if (!cartDtoData.status) |
| | | { |
| | | jm.msg = "1"; |