diff --git a/README.md b/README.md index 1cc3531..9f9fa36 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ func (obj *_UserAccountTblMgr) FetchByPrimaryKey(ID int) (result UserAccountTbl, ``` -### [more多>>>](https://github.com/xxjwxc/gormt/tree/master/doc/func.md) +### [more>>>](https://github.com/xxjwxc/gormt/tree/master/doc/func.md) ### [how to use call style>>>](https://github.com/xxjwxc/gormt/blob/master/data/view/genfunc/genfunc_test.go) ## 7. build diff --git a/data/view/genfunc/genfunc_test.go b/data/view/genfunc/genfunc_test.go index 403ad47..7255d35 100644 --- a/data/view/genfunc/genfunc_test.go +++ b/data/view/genfunc/genfunc_test.go @@ -33,7 +33,8 @@ func TestFuncGet(t *testing.T) { fmt.Println(account) dbs := db.Where("name = ?", "bbbb") - accounts, err := model.AccountMgr(dbs).Gets() // 多个获取 + accountMgr.UpdateDB(dbs) // 更新数据库 + accounts, err := accountMgr.Gets() // 多个获取 fmt.Println(err) fmt.Println(accounts) } diff --git a/doc/func.md b/doc/func.md index 953d2e5..f49f13b 100644 --- a/doc/func.md +++ b/doc/func.md @@ -16,11 +16,17 @@ - [Index access](#Index-access) ## _BaseMgr + +### OpenRelated : open global related +### CloseRelated : close global related + Basic function. All management types inherit this function. This function provides the underlying common function. ### SetCtx Set context, which is used to set context. The current function is not enabled ### GetDB Get gorm.db original link +### UpdateDB + Update gorm.db original link ### GetIsRelated Get whether to query foreign key Association ### SetIsRelated diff --git a/doc/func_cn.md b/doc/func_cn.md index 2233a00..bc84244 100644 --- a/doc/func_cn.md +++ b/doc/func_cn.md @@ -16,11 +16,15 @@ - [索引方式获取](#索引方式获取) ## _BaseMgr +### OpenRelated : 打开全局预加载 +### CloseRelated : 关闭全局预加载 基础函数。所有管理类型都是继承此函数。此函数提供基础公共函数。 ### SetCtx 设置 context ,用于设置上下文。目前功能未启用 ### GetDB 获取 gorm.DB 原始链接窜 +### UpdateDB + 更新 gorm.DB 原始链接窜 ### GetIsRelated 获取是否查询外键关联 ### SetIsRelated