From 5cddfc8a974628835ac619aca43ebade02c73dd3 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 20 Oct 2023 14:26:06 +0800 Subject: [PATCH 1/2] logo search --- model/gmodel/fs_preprocess_logo_logic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/gmodel/fs_preprocess_logo_logic.go b/model/gmodel/fs_preprocess_logo_logic.go index fb3cfb9d..9a8cc02c 100644 --- a/model/gmodel/fs_preprocess_logo_logic.go +++ b/model/gmodel/fs_preprocess_logo_logic.go @@ -19,7 +19,7 @@ func (p *FsPreprocessLogoModel) PreLogoSearchSuggestions(ctx context.Context, zi for i, v := range keywords { keywords[i] = "+" + v + "*" } - sqlstr := fmt.Sprintf("SELECT * FROM fs_preprocess_logo WHERE MATCH(restaurant_name) AGAINST(? IN BOOLEAN MODE) limit %d;", count) + sqlstr := fmt.Sprintf("SELECT id,restaurant_name,resource_url,address,zip_code,phone,website,is_branch FROM fs_preprocess_logo WHERE MATCH(restaurant_name) AGAINST(? IN BOOLEAN MODE) limit %d;", count) tx := p.db.WithContext(ctx).Model(&FsPreprocessLogo{}).Raw(sqlstr, strings.Join(keywords, " ")) err = tx.Scan(&resp).Error From 441faaa1043990b1dc76c51502e2deae71197181 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 20 Oct 2023 14:27:48 +0800 Subject: [PATCH 2/2] logo search --- model/gmodel/fs_preprocess_logo_logic.go | 1 - 1 file changed, 1 deletion(-) diff --git a/model/gmodel/fs_preprocess_logo_logic.go b/model/gmodel/fs_preprocess_logo_logic.go index 9a8cc02c..aee1dbee 100644 --- a/model/gmodel/fs_preprocess_logo_logic.go +++ b/model/gmodel/fs_preprocess_logo_logic.go @@ -33,7 +33,6 @@ func (p *FsPreprocessLogoModel) PreLogoSearchSuggestions(ctx context.Context, zi } return resp, nil - } var testData = []string{