修复delete方法的BUG

This commit is contained in:
白茶清欢 2023-03-19 12:46:22 +08:00
parent 9f569069d5
commit 2c9983a2d3

View File

@ -56,8 +56,8 @@ func (b *BaseDao) List(dbInstance *gorm.DB, result interface{}, optionFuncList .
// //
// Date : 11:46 2023/2/9 // Date : 11:46 2023/2/9
func (b *BaseDao) Delete(dbInstance *gorm.DB, dataModel interface{}, optionFuncList ...SetOption) (int64, error) { func (b *BaseDao) Delete(dbInstance *gorm.DB, dataModel interface{}, optionFuncList ...SetOption) (int64, error) {
dbInstance = b.setTxCondition(dbInstance, optionFuncList...) dbInstance = b.setTxCondition(dbInstance, optionFuncList...).Table(b.TableName).Delete(dataModel)
return dbInstance.Table(b.TableName).Delete(dataModel).RowsAffected, dbInstance.Delete(dataModel).Error return dbInstance.RowsAffected, dbInstance.Error
} }
// Detail 查询详情 // Detail 查询详情