fix
This commit is contained in:
@@ -99,7 +99,7 @@ func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, useri
|
||||
}
|
||||
//获取模板
|
||||
productTemplateModel := gmodel.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn)
|
||||
productTemplatesV2, err := productTemplateModel.FindAllByProductIds(l.ctx, productIds)
|
||||
productTemplatesV2, err := productTemplateModel.FindAllByProductIds(l.ctx, productIds, "")
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "get product template_v2 err")
|
||||
|
||||
@@ -90,7 +90,7 @@ func (l *GetTagProductListLogic) GetTagProductList(req *types.GetTagProductListR
|
||||
productTemplatesV2 []gmodel.FsProductTemplateV2 //产品模板列表(select 字段需要看查询的地方)
|
||||
productSizeCountList []gmodel.CountProductSizeByStatusRsp //产品尺寸数量列表(select 字段需要看查询的地方)
|
||||
mapProductSizeCount = make(map[int64]int64) //产品尺寸数量map
|
||||
mapProductTemplate = make(map[int64]struct{}) //产品模板map
|
||||
mapProductTemplate = make(map[int64]int64) //产品模板map
|
||||
)
|
||||
//携带产品
|
||||
if req.WithProduct {
|
||||
@@ -170,13 +170,14 @@ func (l *GetTagProductListLogic) GetTagProductList(req *types.GetTagProductListR
|
||||
}
|
||||
}
|
||||
//获取模板(只是获取产品product_id)
|
||||
productTemplatesV2, err = l.svcCtx.AllModels.FsProductTemplateV2.FindAllByProductIds(l.ctx, productIds, "product_id")
|
||||
productTemplatesV2, err = l.svcCtx.AllModels.FsProductTemplateV2.FindAllByProductIds(l.ctx, productIds, "sort ASC", "product_id")
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "get product template_v2 err")
|
||||
}
|
||||
//只存第一个
|
||||
for _, v := range productTemplatesV2 {
|
||||
mapProductTemplate[*v.ProductId] = struct{}{}
|
||||
mapProductTemplate[*v.ProductId] = v.Id
|
||||
}
|
||||
//获取产品尺寸数量
|
||||
productSizeCountList, err = l.svcCtx.AllModels.FsProductSize.GetGroupProductSizeByStatus(l.ctx, productIds, 1)
|
||||
@@ -225,7 +226,7 @@ type dealWithTagMenuDataReq struct {
|
||||
MapTagProp map[int64][]types.CoverDefaultItem
|
||||
ProductTagPropList []gmodel.FsProductTagProp
|
||||
MapProductMinPrice map[int64]int64
|
||||
MapProductTemplate map[int64]struct{}
|
||||
MapProductTemplate map[int64]int64
|
||||
MapProductSizeCount map[int64]int64
|
||||
MapTagLevel map[string]*types.TagItem
|
||||
MapProductHaveOptionFitting map[int64]struct{}
|
||||
@@ -334,7 +335,7 @@ type getTagProductsReq struct {
|
||||
ProductList []gmodel.FsProduct
|
||||
MapTagProp map[int64][]types.CoverDefaultItem
|
||||
MapProductMinPrice map[int64]int64
|
||||
MapProductTemplate map[int64]struct{}
|
||||
MapProductTemplate map[int64]int64
|
||||
MapProductSizeCount map[int64]int64
|
||||
MapProductHaveOptionFitting map[int64]struct{}
|
||||
Size uint32
|
||||
@@ -350,7 +351,7 @@ func (l *GetTagProductListLogic) getTagProducts(req getTagProductsReq) (productL
|
||||
continue
|
||||
}
|
||||
minPrice, ok := req.MapProductMinPrice[productInfo.Id]
|
||||
_, tmpOk := req.MapProductTemplate[productInfo.Id]
|
||||
templateId, tmpOk := req.MapProductTemplate[productInfo.Id]
|
||||
//无最小价格则不显示 || 没有模板也不显示
|
||||
if !ok || !tmpOk {
|
||||
continue
|
||||
@@ -370,6 +371,7 @@ func (l *GetTagProductListLogic) getTagProducts(req getTagProductsReq) (productL
|
||||
Title: *productInfo.Title,
|
||||
SizeNum: uint32(sizeNum),
|
||||
CoverDefault: []types.CoverDefaultItem{},
|
||||
DefaultTemplateId: templateId,
|
||||
MinPrice: minPrice,
|
||||
HaveOptionalFitting: haveOptionalFitting,
|
||||
Recommended: *productInfo.IsRecommend > 0,
|
||||
|
||||
@@ -130,7 +130,7 @@ func (l *HomePageRecommendProductListLogic) HomePageRecommendProductList(req *ty
|
||||
}
|
||||
}
|
||||
//获取模板(只是获取产品product_id)
|
||||
productTemplatesV2, err = l.svcCtx.AllModels.FsProductTemplateV2.FindAllByProductIds(l.ctx, productIds, "product_id")
|
||||
productTemplatesV2, err = l.svcCtx.AllModels.FsProductTemplateV2.FindAllByProductIds(l.ctx, productIds, "", "product_id")
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "get product template_v2 err")
|
||||
|
||||
@@ -275,6 +275,7 @@ type TagProduct struct {
|
||||
SizeNum uint32 `json:"size_num"`
|
||||
MinPrice int64 `json:"min_price"`
|
||||
CoverDefault []CoverDefaultItem `json:"cover_default"`
|
||||
DefaultTemplateId int64 `json:"default_template_id"`
|
||||
HaveOptionalFitting bool `json:"have_optional_fitting"`
|
||||
Recommended bool `json:"recommended"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user