This commit is contained in:
wangchuxiao
2023-01-17 17:47:13 +08:00
parent 0f17f52c2c
commit adccfff581
4 changed files with 192 additions and 6 deletions
+2 -2
View File
@@ -56,11 +56,11 @@ func (*Group) UpdateByMap(ctx context.Context, groupID string, args map[string]i
return utils.Wrap(GroupDB.Where("group_id = ?", groupID).Updates(args).Error, "")
}
func (*Group) Update(ctx context.Context, groups []*Group) (err error) {
func (g *Group) Update(ctx context.Context, groups []*Group, tx ...*gorm.DB) (err error) {
defer func() {
trace_log.SetCtxDebug(ctx, utils.GetFuncName(1), err, "groups", groups)
}()
return utils.Wrap(GroupDB.Updates(&groups).Error, "")
return utils.Wrap(getDBConn(g.DB, tx...).Updates(&groups).Error, "")
}
func (*Group) Find(ctx context.Context, groupIDs []string) (groups []*Group, err error) {