/// <summary> /// 更新分类的有效商品数量 /// </summary> /// <returns>更新商品分类数</returns> public static bool UpdateCategoryGoodsCount() { Goodscategoryinfo[] goodsArray = DTO.GetGoodsCategoryInfoArray(GoodsCategories.GetCategoriesTable()); if (goodsArray == null) { return(true); } foreach (Goodscategoryinfo goodsCategoryInfo in goodsArray) { if (goodsCategoryInfo != null && goodsCategoryInfo.Categoryid > 0) { goodsCategoryInfo.Goodscount = Goods.GetGoodsCount(goodsCategoryInfo.Categoryid, ""); GoodsCategories.UpdateGoodsCategory(goodsCategoryInfo); } } return(true); }
/// <summary> /// 获取(根)商品分类信息 /// </summary> /// <returns></returns> public static Goodscategoryinfo[] GetShopRootCategory() { return(DTO.GetGoodsCategoryInfoArray(DbProvider.GetInstance().GetRootCategoriesTable())); }