logo search
This commit is contained in:
parent
a72c033e5b
commit
1859a028aa
@ -31,7 +31,7 @@ func (p *FsPreprocessLogoModel) PreLogoSearch(ctx context.Context, zipcode strin
|
|||||||
for i, v := range keywords {
|
for i, v := range keywords {
|
||||||
keywords[i] = "+" + v + "*"
|
keywords[i] = "+" + v + "*"
|
||||||
}
|
}
|
||||||
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) and zipcode = ? 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) and zip_code = ? limit %d;", count)
|
||||||
|
|
||||||
tx := p.db.WithContext(ctx).Model(&FsPreprocessLogo{}).Raw(sqlstr, strings.Join(keywords, " "), zipcode)
|
tx := p.db.WithContext(ctx).Model(&FsPreprocessLogo{}).Raw(sqlstr, strings.Join(keywords, " "), zipcode)
|
||||||
err = tx.Scan(&resp).Error
|
err = tx.Scan(&resp).Error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user