diff --git a/base.go b/base.go index 01f08e4..cc1d7fc 100644 --- a/base.go +++ b/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 查询数据列表