Merge 5ad24449bd5e2e4f4cc1314e1369dead8e621f4c into d1fcba9bfc0a7b95bf3fd6c8abb24a8a4200f80f

This commit is contained in:
everclear 2016-02-04 19:25:22 +00:00
commit bd3172684a

View File

@ -17,10 +17,7 @@ func (scope *Scope) primaryCondition(value interface{}) string {
func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str string) {
switch value := clause["query"].(type) {
case string:
// if string is number
if regexp.MustCompile("^\\s*\\d+\\s*$").MatchString(value) {
return scope.primaryCondition(scope.AddToVars(value))
} else if value != "" {
if value != "" {
str = fmt.Sprintf("(%v)", value)
}
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, sql.NullInt64: