query.go 446 B

123456789101112131415
  1. package report_chapter_ticker
  2. import (
  3. "hongze/hongze_yb/global"
  4. "hongze/hongze_yb/utils"
  5. )
  6. // GetTickerByChapterId 根据章节ID获取指标列表
  7. func GetTickerByChapterId(reportChapterId int) (list []*reportChapterTicker, err error) {
  8. err = global.MYSQL["rddp"].Model(reportChapterTicker{}).Where("report_chapter_id = ?", reportChapterId).Order("sort asc, id asc").Scan(&list).Error
  9. if err == utils.ErrNoRow {
  10. err = nil
  11. }
  12. return
  13. }