fix:优化搜索

This commit is contained in:
lifei6671
2018-12-24 15:23:17 +08:00
parent 329b87c685
commit d735ea27ca
3 changed files with 14 additions and 2 deletions

8
utils/sqltil/sql.go Normal file
View File

@@ -0,0 +1,8 @@
package sqltil
import "strings"
//转义like语法的%_符号
func EscapeLike(keyword string) string {
return strings.Replace(strings.Replace(keyword,"_","\\_",-1),"%","\\%",-1)
}