Merge 5ad24449bd5e2e4f4cc1314e1369dead8e621f4c into d1fcba9bfc0a7b95bf3fd6c8abb24a8a4200f80f
This commit is contained in:
commit
bd3172684a
@ -17,10 +17,7 @@ func (scope *Scope) primaryCondition(value interface{}) string {
|
|||||||
func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str string) {
|
func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str string) {
|
||||||
switch value := clause["query"].(type) {
|
switch value := clause["query"].(type) {
|
||||||
case string:
|
case string:
|
||||||
// if string is number
|
if value != "" {
|
||||||
if regexp.MustCompile("^\\s*\\d+\\s*$").MatchString(value) {
|
|
||||||
return scope.primaryCondition(scope.AddToVars(value))
|
|
||||||
} else if value != "" {
|
|
||||||
str = fmt.Sprintf("(%v)", value)
|
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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user