We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a04d6f commit 0bf8d34Copy full SHA for 0bf8d34
models/admin.go
@@ -114,6 +114,11 @@ func DeleteNotice(id int64) error {
114
115
// DeleteNotices deletes all notices with ID from start to end (inclusive).
116
func DeleteNotices(start, end int64) error {
117
+ if start == 0 && end == 0 {
118
+ _, err := x.Exec("DELETE FROM notice")
119
+ return err
120
+ }
121
+
122
sess := x.Where("id >= ?", start)
123
if end > 0 {
124
sess.And("id <= ?", end)
0 commit comments