提交 23a51b39 authored 作者: mooncake's avatar mooncake

update

上级 73eac9db
......@@ -14,7 +14,7 @@ const (
Tag2 = "query"
)
func Scopes(where any) func(db *gorm.DB) *gorm.DB {
func MakeScopes(where any) func(db *gorm.DB) *gorm.DB {
return func(db *gorm.DB) *gorm.DB {
return makeScopes(db, where)
}
......
......@@ -24,7 +24,7 @@ func TestMakeWhere(t *testing.T) {
in.IDs = []xsf.ID{10, 2, 3}
in.UserID = 10
in.SiteName = "优盟"
scopes := gormutils.Scopes(in)
scopes := gormutils.MakeScopes(in)
conn := getConn()
var rs []*User
if e := conn.WithContext(context.TODO()).
......@@ -53,7 +53,6 @@ func getConn() *gorm.DB {
},
)
dsn := "root:123456@tcp(localhost:30006)/qitu_operator?charset=utf8mb4&parseTime=True&loc=Local"
// 方法2:全局DryRun配置
con, _ := gorm.Open(mysql.Open(dsn), &gorm.Config{Logger: newLogger})
return con
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论