Browse Source

improve empty notice (#15890)

tags/v1.15.0-rc1
Lunny Xiao 3 years ago
parent
commit
0bf8d34630
No account linked to committer's email address
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      models/admin.go

+ 5
- 0
models/admin.go View File

@@ -114,6 +114,11 @@ func DeleteNotice(id int64) error {

// DeleteNotices deletes all notices with ID from start to end (inclusive).
func DeleteNotices(start, end int64) error {
if start == 0 && end == 0 {
_, err := x.Exec("DELETE FROM notice")
return err
}

sess := x.Where("id >= ?", start)
if end > 0 {
sess.And("id <= ?", end)

Loading…
Cancel
Save