Browse Source

update

tmp
DengBiao 10 months ago
parent
commit
85bee6eeaa
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/db/db_notice.go

+ 2
- 2
app/db/db_notice.go View File

@@ -50,11 +50,11 @@ func (noticeDb *NoticeDb) FindNoticeById(ids interface{}) (*[]model.Notice, erro
func (noticeDb *NoticeDb) FindNotice(limit, start int) (*[]model.Notice, error) {
var m []model.Notice
if limit == 0 || start == 0 {
if err := noticeDb.Db.Asc("sort").Find(&m); err != nil {
if err := noticeDb.Db.Where("is_pop_to_central_kitchen = 0").Asc("sort").Find(&m); err != nil {
return nil, logx.Error(err)
}
} else {
if err := noticeDb.Db.Asc("sort").Limit(limit, start).Find(m); err != nil {
if err := noticeDb.Db.Where("is_pop_to_central_kitchen = 0").Asc("sort").Limit(limit, start).Find(m); err != nil {
return nil, logx.Error(err)
}
}


Loading…
Cancel
Save