func base template update

This commit is contained in:
谢小军
2019-12-17 19:26:44 +08:00
parent 95ec33c371
commit 5fb1c32e55
4 changed files with 104 additions and 22 deletions

View File

@@ -9,7 +9,8 @@ import (
// prepare for outher
type _BaseMgr struct {
*gorm.DB
ctx *context.Context
ctx *context.Context
isRelated bool
}
// SetCtx set context
@@ -22,6 +23,11 @@ func (obj *_BaseMgr) GetDB() *gorm.DB {
return obj.DB
}
// IsRelated Query foreign key Association.是否查询外键关联(gorm.Related)
func (obj *_BaseMgr) IsRelated(b bool) {
obj.isRelated = b
}
type options struct {
query map[string]interface{}
}