added batch delete action

This commit is contained in:
zhangwenjian committed 2020-05-05 02:33:35 +08:00
1 parent 9e2726cbbb
commit ef26a2b864
6 files changed
+34 -17

No files matched your search

+9
View File
@@ -105,3 +105,12 @@ func (e *SysConfig) Delete() (success bool, err error) {
success = true
return
}
func (e *SysConfig) BatchDelete(id []int) (Result bool, err error) {
if err = orm.Eloquent.Table(e.TableName()).Where("config_id in (?)", id).Delete(&SysConfig{}).Error; err != nil {
return
}
Result = true
return
}
+8
View File
@@ -131,3 +131,11 @@ func (e *DictData) Delete(id int) (success bool, err error) {
success = true
return
}
func (e *DictData) BatchDelete(id []int) (Result bool, err error) {
if err = orm.Eloquent.Table(e.TableName()).Where("dict_code in (?)", id).Delete(&DictData{}).Error; err != nil {
return
}
Result = true
return
}
+8
View File
@@ -119,3 +119,11 @@ func (e *DictType) Delete(id int) (success bool, err error) {
success = true
return
}
func (e *DictType) BatchDelete(id []int) (Result bool, err error) {
if err = orm.Eloquent.Table(e.TableName()).Where("dict_id in (?)", id).Delete(&DictType{}).Error; err != nil {
return
}
Result = true
return
}