func base template update
This commit is contained in:
@@ -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{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user