diff --git a/model/gmodel/fs_product_tag_prop_logic.go b/model/gmodel/fs_product_tag_prop_logic.go index 6612e196..338a61d1 100644 --- a/model/gmodel/fs_product_tag_prop_logic.go +++ b/model/gmodel/fs_product_tag_prop_logic.go @@ -5,7 +5,7 @@ import "context" // TODO: 使用model的属性做你想做的 type GetTagPropByProductIdsWithProductTagRsp struct { FsProductTagProp - Title string `json:"title"` + TemplateTag string `json:"template_tag"` } func (p *FsProductTagPropModel) GetTagPropByProductIdsWithProductTag(ctx context.Context, productIds []int64) (resp []GetTagPropByProductIdsWithProductTagRsp, err error) { @@ -14,7 +14,7 @@ func (p *FsProductTagPropModel) GetTagPropByProductIdsWithProductTag(ctx context } err = p.db.WithContext(ctx).Table(p.name+" as p "). Joins("left join fs_product_template_tags as t on p.template_tag_id = t.id"). - Select("p.*,t.title as title"). + Select("p.*,t.template_tag as template_tag"). Where("p.product_id in (?) and p.status = ? and t.status = ?", productIds, 1, 1). Find(&resp).Error return resp, err diff --git a/server/product/internal/logic/getrecommandproductlistlogic.go b/server/product/internal/logic/getrecommandproductlistlogic.go index d73206c7..7f082fef 100644 --- a/server/product/internal/logic/getrecommandproductlistlogic.go +++ b/server/product/internal/logic/getrecommandproductlistlogic.go @@ -127,7 +127,7 @@ func (l *GetRecommandProductListLogic) GetRecommandProductList(req *types.GetRec mapTagProp := make(map[int64][]types.CoverDefaultItem) for _, v := range productTagPropList { mapTagProp[*v.ProductId] = append(mapTagProp[*v.ProductId], types.CoverDefaultItem{ - Tag: v.Title, + Tag: v.TemplateTag, Cover: *v.Cover, }) } diff --git a/server/product/internal/logic/gettagproductlistlogic.go b/server/product/internal/logic/gettagproductlistlogic.go index 480e2bc1..9b84207e 100644 --- a/server/product/internal/logic/gettagproductlistlogic.go +++ b/server/product/internal/logic/gettagproductlistlogic.go @@ -138,7 +138,7 @@ func (l *GetTagProductListLogic) GetTagProductList(req *types.GetTagProductListR } for _, v := range productTagPropList { mapTagProp[*v.ProductId] = append(mapTagProp[*v.ProductId], types.CoverDefaultItem{ - Tag: v.Title, + Tag: v.TemplateTag, Cover: *v.Cover, }) } diff --git a/server/product/internal/logic/homepagerecommendproductlistlogic.go b/server/product/internal/logic/homepagerecommendproductlistlogic.go index a8bd03df..6d449757 100644 --- a/server/product/internal/logic/homepagerecommendproductlistlogic.go +++ b/server/product/internal/logic/homepagerecommendproductlistlogic.go @@ -156,7 +156,7 @@ func (l *HomePageRecommendProductListLogic) HomePageRecommendProductList(req *ty mapTagProp := make(map[int64][]types.CoverDefaultItem) for _, v := range productTagPropList { mapTagProp[*v.ProductId] = append(mapTagProp[*v.ProductId], types.CoverDefaultItem{ - Tag: v.Title, + Tag: v.TemplateTag, Cover: *v.Cover, }) }