meeting_probabilities.go 956 B

123456789101112131415161718192021222324252627282930313233
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // MeetingProbabilities 加息表格详情表
  7. type MeetingProbabilities struct {
  8. MeetingInfoId int `orm:"column(meeting_info_id);pk"`
  9. DateTime string // 数据日期
  10. Content string // 表格内容
  11. ExcelImage string // 表格图片
  12. IsDelete int // 是否删除,0:未删除,1:已删除
  13. CreateTime time.Time
  14. ModifyTime time.Time
  15. }
  16. // GetMeetingInfoById 根据id 获取加息概率表格详情
  17. func GetMeetingInfoById(dateTime string) (item *MeetingProbabilities, err error) {
  18. o := orm.NewOrmUsingDB("data")
  19. sql := ``
  20. if dateTime == "" {
  21. sql = ` SELECT * FROM meeting_probabilities WHERE is_delete=0 ORDER BY create_time DESC LIMIT 1 `
  22. err = o.Raw(sql).QueryRow(&item)
  23. return
  24. } else {
  25. sql = ` SELECT * FROM meeting_probabilities WHERE date_time=? AND is_delete=0 `
  26. err = o.Raw(sql, dateTime).QueryRow(&item)
  27. return
  28. }
  29. }