This commit is contained in:
laodaming
2023-09-11 13:05:31 +08:00
parent 2553c6c821
commit cc7fcb2133
2 changed files with 11 additions and 11 deletions

View File

@@ -23,8 +23,8 @@ func (pt *FsProductTemplateTagsModel) FindOne(ctx context.Context, id int64, fie
err = db.Take(&resp).Error
return resp, err
}
func (pt *FsProductTemplateTagsModel) GetList(ctx context.Context, page, limit int, isHide, status int64, orderBy string) (resp []FsProductTemplateTags, err error) {
db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`is_hide` = ? and `status` = ?", isHide, status)
func (pt *FsProductTemplateTagsModel) GetList(ctx context.Context, page, limit int, status int64, orderBy string) (resp []FsProductTemplateTags, err error) {
db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where(" `status` = ?", status)
if orderBy != "" {
db = db.Order(orderBy)
}
@@ -32,11 +32,11 @@ func (pt *FsProductTemplateTagsModel) GetList(ctx context.Context, page, limit i
err = db.Offset(offset).Limit(limit).Find(&resp).Error
return resp, err
}
func (pt *FsProductTemplateTagsModel) GetListByTagNames(ctx context.Context, tagNames []string, limit int, isHide, status int64, orderBy string) (resp []FsProductTemplateTags, err error) {
func (pt *FsProductTemplateTagsModel) GetListByTagNames(ctx context.Context, tagNames []string, limit int, status int64, orderBy string) (resp []FsProductTemplateTags, err error) {
if len(tagNames) == 0 {
return nil, nil
}
db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`template_tag` in (?) and `is_hide` = ? and `status` = ?", tagNames, isHide, status)
db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`template_tag` in (?) and `status` = ?", tagNames, status)
if orderBy != "" {
db = db.Order(orderBy)
}