update delete func

This commit is contained in:
白茶清欢 2024-01-15 15:30:15 +08:00
parent f6bac5a5a0
commit 4d795cba8b

View File

@ -74,6 +74,7 @@ func (b *BaseDao) List(dbInstance *gorm.DB, result interface{}, optionFuncList .
//
// Date : 11:46 2023/2/9
func (b *BaseDao) Delete(dbInstance *gorm.DB, dataModel interface{}, optionFuncList ...SetOption) (int64, error) {
dbInstance = dbInstance.Model(dataModel)
dbInstance = b.setTxCondition(dbInstance, optionFuncList...).Delete(dataModel)
return dbInstance.RowsAffected, dbInstance.Error
}