Merge pull request #178 from 15ho/master

fix #170
master
xxj 3 years ago committed by GitHub
commit 2f8f6f51cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -85,4 +85,5 @@ var TypeMysqlMatchList = []struct {
{`^(integer)[(]\d+[)]`, "int"}, {`^(integer)[(]\d+[)]`, "int"},
{`^(timestamp)[(]\d+[)]`, "time.Time"}, {`^(timestamp)[(]\d+[)]`, "time.Time"},
{`^(geometry)[(]\d+[)]`, "[]byte"}, {`^(geometry)[(]\d+[)]`, "[]byte"},
{`^(set)[(][\s\S]+[)]`, "string"},
} }

@ -142,8 +142,8 @@ func TestFuncFetchBy(t *testing.T) {
func TestCondition(t *testing.T) { func TestCondition(t *testing.T) {
condition := model.Condition{} condition := model.Condition{}
condition.And(model.AccountColumns.AccountID, ">=", "1") condition.And(model.AccountColumns.AccountID, ">=", "1")
condition.And(model.AccountColumns.UserID, "in", "1", "2", "3") condition.And(model.AccountColumns.UserID, "in", []string{"1", "2", "3"})
condition.Or(model.AccountColumns.Type, "in", "1", "2", "3") condition.Or(model.AccountColumns.Type, "in", []string{"1", "2", "3"})
where, obj := condition.Get() where, obj := condition.Get()
fmt.Println(where) fmt.Println(where)

Loading…
Cancel
Save