diff --git a/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs b/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs index bd86af63..59891c5e 100644 --- a/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs +++ b/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using CoreCms.Net.Model.FromBody; using SqlSugar; namespace CoreCms.Net.Model.Entities @@ -108,6 +109,11 @@ namespace CoreCms.Net.Model.Entities [SugarColumn(IsIgnore = true)] public List sku { get; set; } = new(); + /// + /// 商品规格 + /// + [SugarColumn(IsIgnore = true)] + public Dictionary> specification { get; set; } = new(); /// /// 是否收藏 @@ -176,5 +182,19 @@ namespace CoreCms.Net.Model.Entities [SugarColumn(IsIgnore = true)] public DateTime groupEndTime { get; set; } [SugarColumn(IsIgnore = true)] public int groupTimestamp { get; set; } + + + /// + /// sku最小价格 + /// + [SugarColumn(IsIgnore = true)] + public decimal minPrice { get; set; } = 0; + + /// + /// sku最大价格 + /// + [SugarColumn(IsIgnore = true)] + public decimal maxPrice { get; set; } = 0; + } } \ No newline at end of file diff --git a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs index c6ca0960..ef57b02f 100644 --- a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs +++ b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs @@ -538,6 +538,15 @@ namespace CoreCms.Net.Services model.freezeStock = getProductInfo.freezeStock; model.weight = getProductInfo.weight; + var minProduct = await _productsServices.QueryByClauseAsync(p => p.isDel == false && p.goodsId == id, + p => p.price, OrderByType.Asc); + + var maxProduct = await _productsServices.QueryByClauseAsync(p => p.isDel == false && p.goodsId == id, + p => p.price, OrderByType.Desc); + + model.minPrice = minProduct.price; + model.maxPrice = maxProduct.price; + //获取品牌 var brand = await _brandServices.QueryByIdAsync(model.brandId); model.brand = brand; diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-spec/coreshop-spec.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-spec/coreshop-spec.vue index b6724634..d881f971 100644 --- a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-spec/coreshop-spec.vue +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-spec/coreshop-spec.vue @@ -1,6 +1,5 @@