Skip to content

Commit

Permalink
Fix Where with string
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Jan 20, 2015
1 parent 2069364 commit f8e4e16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (d *mysql) SqlTag(value reflect.Value, size int) string {
}
case reflect.Struct:
if value.Type() == timeType {
return "datetime"
return "timestamp"
}
default:
if _, ok := value.Interface().([]byte); ok {
Expand Down
2 changes: 1 addition & 1 deletion scope_private.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str stri
id, _ := strconv.Atoi(value)
return scope.primaryCondiation(scope.AddToVars(id))
} else {
str = value
str = fmt.Sprintf("(%v)", value)
}
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
return scope.primaryCondiation(scope.AddToVars(value))
Expand Down

0 comments on commit f8e4e16

Please sign in to comment.