added BatchDelete action

This commit is contained in:
zhangwenjian
2020-05-05 02:02:58 +08:00
parent f116859711
commit 8d844b00dd
9 changed files with 48 additions and 21 deletions
+8
View File
@@ -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
}