增加删除配置接口
This commit is contained in:
@ -97,6 +97,15 @@ func (b *base) Detail(dbInstance *gorm.DB, condition interface{}, result interfa
|
||||
return dbInstance.First(result, condition).Error
|
||||
}
|
||||
|
||||
// Delete 删除数据
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 12:24 下午 2021/12/1
|
||||
func (b *base) Delete(dbInstance *gorm.DB, table string, primaryID int64, model interface{}) error {
|
||||
return dbInstance.Table(table).Where("id = ?", primaryID).Delete(model).Error
|
||||
}
|
||||
|
||||
// Count 查询数量
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Reference in New Issue
Block a user