数据库支持更新一条数据
This commit is contained in:
10
base.go
10
base.go
@ -48,6 +48,16 @@ func (b *BaseDao) Update(dbInstance *gorm.DB, updateData interface{}, optionFunc
|
||||
return r.RowsAffected, r.Error
|
||||
}
|
||||
|
||||
// UpdateOne 更新一条数据
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 17:05 2024/1/13
|
||||
func (b *BaseDao) UpdateOne(dbInstance *gorm.DB, updateData interface{}, optionFuncList ...SetOption) (int64, error) {
|
||||
optionFuncList = append(optionFuncList, WithLimit(1, 0))
|
||||
return b.Update(dbInstance, updateData, optionFuncList...)
|
||||
}
|
||||
|
||||
// List 查询数据列表
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Reference in New Issue
Block a user