Merge pull request #178 from 15ho/master

fix #170
This commit is contained in:
xxj
2021-12-08 19:05:31 +08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

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

View File

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