This commit is contained in:
laodaming
2023-09-20 17:11:48 +08:00
parent 29f1122120
commit 18aaef0e31
4 changed files with 28 additions and 8 deletions

View File

@@ -43,8 +43,8 @@ func (pt *FsProductTemplateTagsModel) GetListByTagNames(ctx context.Context, tag
err = db.Limit(limit).Find(&resp).Error
return resp, err
}
func (pt *FsProductTemplateTagsModel) FindOneByTagName(ctx context.Context, tagName string, fields ...string) (resp *FsProductTemplateTags, err error) {
db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`template_tag` = ? and `status` = ?", tagName, 1)
func (pt *FsProductTemplateTagsModel) FindOneByTagName(ctx context.Context, templateTagName string, fields ...string) (resp *FsProductTemplateTags, err error) {
db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`template_tag` = ? and `status` = ?", templateTagName, 1)
if len(fields) != 0 {
db = db.Select(fields[0])
}