Merge branch 'feat/tag/search' into 'main'

fix: tag get list sql grammatical mistake

See merge request opensource/answer!35
This commit is contained in:
linkinstar 2022-09-30 07:04:51 +00:00
commit bffdc273d0
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ func (tr *tagRepo) GetTagBySlugName(ctx context.Context, slugName string) (tagIn
// GetTagListByName get tag list all like name
func (tr *tagRepo) GetTagListByName(ctx context.Context, name string, limit int) (tagList []*entity.Tag, err error) {
tagList = make([]*entity.Tag, 0)
session := tr.data.DB.Where("LIKE ?", name+"%")
session := tr.data.DB.Where("slug_name LIKE ?", name+"%")
session.Where(builder.Eq{"status": entity.TagStatusAvailable})
session.Limit(limit).Asc("slug_name")
err = session.Find(&tagList)