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