logo search

This commit is contained in:
eson 2023-10-20 14:06:36 +08:00
parent d9d16753c0
commit c136231742

View File

@ -15,7 +15,7 @@ func (p *FsPreprocessLogoModel) PreLogoSearchSuggestions(ctx context.Context, zi
for i, v := range keywords {
keywords[i] = "+" + v + v
}
sqlstr := fmt.Sprintf("SELECT * FROM fs_preprocess_logo WHERE MATCH(restaurant_name) AGAINST('?' IN BOOLEAN MODE) limit %d;", count)
sqlstr := fmt.Sprintf("SELECT * 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