Merge 9d085dafdb21a1123e0dbb078be616423c8c4f56 into 9739cb853cbfb312fb0e20c7643588004cb50e4d

This commit is contained in:
minjatJ 2016-01-18 14:03:06 +00:00
commit 2c94b98f4d

View File

@ -21,7 +21,11 @@ func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str stri
if regexp.MustCompile("^\\s*\\d+\\s*$").MatchString(value) { if regexp.MustCompile("^\\s*\\d+\\s*$").MatchString(value) {
return scope.primaryCondition(scope.AddToVars(value)) return scope.primaryCondition(scope.AddToVars(value))
} else if value != "" { } else if value != "" {
str = fmt.Sprintf("(%v)", value) if regexp.MustCompile("^[a-zA-Z0-9]+$").MatchString(value) {
return scope.primaryCondition(scope.AddToVars(value))
} else {
str = fmt.Sprintf("(%v)", value)
}
} }
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, sql.NullInt64: case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, sql.NullInt64:
return scope.primaryCondition(scope.AddToVars(value)) return scope.primaryCondition(scope.AddToVars(value))