更新数量获取

This commit is contained in:
白茶清欢 2022-07-17 21:43:01 +08:00
parent cf7789b970
commit 0bda3657c6

View File

@ -60,7 +60,7 @@ func (b *BaseDao) Detail(dbInstance *gorm.DB, table string, result interface{},
func (b *BaseDao) Count(dbInstance *gorm.DB, table string, optionFuncList ...SetOption) (int64, error) {
b.setTxCondition(dbInstance, table, optionFuncList...)
var cnt int64
return cnt, dbInstance.Count(&cnt).Error
return cnt, dbInstance.Table(table).Count(&cnt).Error
}
// Begin 开启事务