We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c165e8b commit ba228b7Copy full SHA for ba228b7
1 file changed
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