From 7ff0114a9f860a5c0faa37f21554b02ec0c1ca1d Mon Sep 17 00:00:00 2001 From: howell <2827207845@qq.com> Date: Fri, 11 Feb 2022 14:02:49 +0800 Subject: [PATCH] fix: min and limit --- internal/api/mobile/goods/detail.go | 8 +++++++- internal/model/goods/sku.go | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/api/mobile/goods/detail.go b/internal/api/mobile/goods/detail.go index 9d23eb1..e56731a 100644 --- a/internal/api/mobile/goods/detail.go +++ b/internal/api/mobile/goods/detail.go @@ -60,6 +60,8 @@ type priceSub struct { Commission decimal.Decimal `gorm:"column:commission" json:"commission"` Ferme decimal.Decimal `json:"ferme"` SalePrice decimal.Decimal `json:"sale_price"` + Min uint `json:"min"` + Limit uint `json:"limit"` } type allPrice struct { @@ -362,12 +364,16 @@ func QueryGoodsDetailNew(c *gin.Context) { DiscountPrice: minAllPrice.DiscountPrice, Commission: minCommission1.Add(minCommission2).Add(minCommission3), SalePrice: minAllPrice.SalePrice, + Min: minAllPrice.Min, + Limit: minAllPrice.Limit, }, priceSub{ OriginalPrice: maxAllPrice.OriginalPrice, DiscountPrice: maxAllPrice.DiscountPrice, Commission: maxCommission1.Add(maxCommission2).Add(maxCommission3), - SalePrice: minAllPrice.SalePrice, + SalePrice: maxAllPrice.SalePrice, + Min: maxAllPrice.Min, + Limit: minAllPrice.Limit, }, } //if summary.IsFerme == goods2.RecookGoodsInfoIsFermeTrue { diff --git a/internal/model/goods/sku.go b/internal/model/goods/sku.go index 0668605..4fd45d1 100755 --- a/internal/model/goods/sku.go +++ b/internal/model/goods/sku.go @@ -29,6 +29,8 @@ type Sku struct { ThirdPartySkuId string `gorm:"column:third_party_sku_id" json:"thirdPartySkuId"` //第三方skuid ThirdPartyType int `gorm:"column:third_party_type" json:"thirdPartySkuType"` //第三方类型 SaleInventory uint `json:"sale_inventory" gorm:"column:sale_inventory"` + Limit uint `json:"limit" gorm:"column:limit_num"` + Min uint `json:"min" gorm:"column:min_num"` } // TableName sets the insert table name for this struct type