mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
added BatchDelete action
This commit is contained in:
@@ -129,3 +129,11 @@ func (e *Post) Delete(id int) (success bool, err error) {
|
||||
success = true
|
||||
return
|
||||
}
|
||||
|
||||
func (e *Post) BatchDelete(id []int) (Result bool, err error) {
|
||||
if err = orm.Eloquent.Table(e.TableName()).Where("post_id in (?)", id).Delete(&Post{}).Error; err != nil {
|
||||
return
|
||||
}
|
||||
Result = true
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user