report_author.go 864 B

1234567891011121314151617181920212223242526
  1. package models
  2. import (
  3. "time"
  4. "github.com/beego/beego/v2/client/orm"
  5. )
  6. type ReportAuthor struct {
  7. Id int `orm:"column(id)" description:"报告作者ID"`
  8. ReportAuthor string `description:"报告作者名称"`
  9. AuthorType int `description:"类型,1:中文;2:英文"`
  10. Enable int `description:"是否启用,0:禁用,1:启用"`
  11. IsDelete int `description:"是否删除,0:未删除,1:已删除"`
  12. CreateTime time.Time `description:"创建时间"`
  13. ModifyTime time.Time `description:"更新时间"`
  14. }
  15. // GetReportAuthorList 获取报告作者列表
  16. func GetReportAuthorList() (items []*ReportAuthor, err error) {
  17. o := orm.NewOrmUsingDB("rddp")
  18. sql := ` SELECT * FROM report_author WHERE is_delete=0 AND enable=1 ORDER BY id desc `
  19. _, err = o.Raw(sql).QueryRows(&items)
  20. return
  21. }