This commit is contained in:
laodaming
2023-08-17 11:14:47 +08:00
parent 748b7e5b66
commit be95ff9d05
4 changed files with 5 additions and 5 deletions

View File

@@ -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