From 96d2e09ab6274fcff68aaf2bf7050a45f6f2152b Mon Sep 17 00:00:00 2001 From: LinkinStar Date: Fri, 30 Sep 2022 15:00:24 +0800 Subject: [PATCH] fix: tag get list sql grammatical mistake --- internal/repo/tag/tag_repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/repo/tag/tag_repo.go b/internal/repo/tag/tag_repo.go index a9c8699d..8478cf2c 100644 --- a/internal/repo/tag/tag_repo.go +++ b/internal/repo/tag/tag_repo.go @@ -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)