This commit is contained in:
laodaming 2023-10-07 11:24:18 +08:00
parent aafcbfcf50
commit d113ef1c6e

View File

@ -146,6 +146,7 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
productSn := snapShot.ProductInfo.ProductSn
//产品封面图资源元数据
var productCoverMetadata interface{}
cartIsSelected := *cart.IsSelected > 0
//产品信息
if productInfo, ok := mapProduct[*cart.ProductId]; ok {
productCover = *productInfo.Cover
@ -154,6 +155,10 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
if metadata, ok := mapResourceMetadata[*productInfo.Cover]; ok {
productCoverMetadata = metadata
}
//产品下架了
if *productInfo.IsShelf == 0 {
cartIsSelected = false
}
}
templateTag := ""
if templateInfo, ok := mapTemplate[*cart.TemplateId]; ok {
@ -193,7 +198,7 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
MinPurchaseQuantity: stepPrice.MinBuyUnitsNum,
StepPurchaseQuantity: stepPurchaseQuantity,
IsHighlyCustomized: *cart.IsHighlyCustomized > 0,
IsSelected: *cart.IsSelected > 0,
IsSelected: cartIsSelected,
TemplateTag: templateTag,
Logo: snapShot.Logo,
RenderImage: snapShot.RenderImage,