更新方法增加影响行数的返回
This commit is contained in:
parent
a76438e7ce
commit
b5574d07ef
5
base.go
5
base.go
@ -26,9 +26,10 @@ func (b *BaseDao) Create(dbInstance *gorm.DB, table string, data interface{}) er
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 8:12 下午 2021/8/8
|
||||
func (b *BaseDao) Update(dbInstance *gorm.DB, table string, updateDate interface{}, optionFuncList ...SetOption) error {
|
||||
func (b *BaseDao) Update(dbInstance *gorm.DB, table string, updateDate interface{}, optionFuncList ...SetOption) (int64, error) {
|
||||
b.setTxCondition(dbInstance, table, optionFuncList...)
|
||||
return dbInstance.Updates(updateDate).Error
|
||||
r := dbInstance.Updates(updateDate)
|
||||
return r.RowsAffected, r.Error
|
||||
}
|
||||
|
||||
// List 查询数据列表
|
||||
|
Loading…
Reference in New Issue
Block a user