mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-09-19 01:58:00 +08:00
fix:优化搜索
This commit is contained in:
8
utils/sqltil/sql.go
Normal file
8
utils/sqltil/sql.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package sqltil
|
||||
|
||||
import "strings"
|
||||
|
||||
//转义like语法的%_符号
|
||||
func EscapeLike(keyword string) string {
|
||||
return strings.Replace(strings.Replace(keyword,"_","\\_",-1),"%","\\%",-1)
|
||||
}
|
Reference in New Issue
Block a user