public static List <ProductCollocationModel> GetDisplayCollocation(long productID)
        {
            var result = new List <ProductCollocationModel>();

            var collocations = Service.GetAvailableCollocationByProduct(productID);

            if (collocations.Count == 0)
            {
                return(result);
            }

            var collProducts = Service.GetProducts(collocations.Select(p => p.Id).ToList());
            var collSKUs     = Service.GetSKUs(collProducts.Select(p => p.Id).ToList());
            var allProducts  = ProductManagerApplication.GetOnSaleProducts(collProducts.Select(p => p.ProductId).ToList());
            var allSKUs      = ProductManagerApplication.GetSKUByProducts(allProducts.Select(p => p.Id).ToList());

            //移除不在销售中的活动商品
            collProducts = collProducts.Where(p => allProducts.Select(o => o.Id).Contains(p.ProductId)).ToList();
            var index = 0;

            foreach (var collocation in collocations)
            {
                var cProducts   = collProducts.Where(p => p.ColloId == collocation.Id);
                var mainProduct = cProducts.FirstOrDefault(p => p.IsMain);
                if (mainProduct == null)
                {
                    continue;                   //主商品不在销售中
                }
                index++;
                var item = new ProductCollocationModel();
                item.Id        = item.Id;
                item.Name      = "组合购" + GetChineseNumber(index);
                item.ProductId = mainProduct.ProductId;
                item.ShopId    = collocation.ShopId;
                item.Products  = cProducts.Select(cp =>
                {
                    var product = allProducts.FirstOrDefault(p => p.Id == cp.ProductId);
                    var skus    = allSKUs.Where(p => p.ProductId == cp.ProductId);
                    var cSKUs   = collSKUs.Where(p => p.ColloProductId == cp.Id);
                    return(new CollocationProducts()
                    {
                        DisplaySequence = cp.DisplaySequence,
                        IsMain = cp.IsMain,
                        Stock = skus.Sum(t => t.Stock),
                        MaxCollPrice = cSKUs.Max(x => x.Price),
                        MaxSalePrice = cSKUs.Max(x => x.SkuPirce),
                        MinCollPrice = cSKUs.Min(x => x.Price),
                        MinSalePrice = cSKUs.Min(x => x.SkuPirce),
                        ProductName = product.ProductName,
                        ProductId = cp.ProductId,
                        ColloPid = cp.Id,
                        Image = Core.HimallIO.GetImagePath(product.RelativePath)
                    });
                }).ToList();
                item.Cheap = item.Products.Sum(a => a.MaxSalePrice) - item.Products.Sum(a => a.MinCollPrice);
                result.Add(item);
            }
            return(result);
        }
        /// <summary>
        /// 获取当前商品可参与的组合购
        /// </summary>
        /// <param name="product"></param>
        /// <returns></returns>
        public static int GetCollocationCount(long product)
        {
            var colls        = Service.GetAvailableCollocationByProduct(product);
            var collProducts = Service.GetProducts(colls.Select(p => p.Id).ToList());
            var products     = ProductManagerApplication.GetOnSaleProducts(collProducts.Select(p => p.ProductId).ToList());
            int result       = 0;

            foreach (var coll in colls)
            {
                var cProduct    = collProducts.Where(p => p.ColloId == coll.Id);
                var mainProduct = cProduct.FirstOrDefault(p => p.IsMain);
                if (products.Any(p => p.Id == mainProduct.ProductId))
                {
                    result++;
                }
            }
            return(result);
        }