report_author.go 459 B

123456789101112131415161718192021
  1. package models
  2. import "rdluck_tools/orm"
  3. type ReportAuthor struct {
  4. Id int `description:"报告作者ID"`
  5. ReportAuthor string `description:"报告作者名称"`
  6. }
  7. //获取报告作者
  8. func GetReportAuthor() (items []*ReportAuthor, err error) {
  9. o := orm.NewOrm()
  10. o.Using("rddp")
  11. sql := ` SELECT * FROM report_author ORDER BY id desc `
  12. _, err = o.Raw(sql).QueryRows(&items)
  13. return
  14. }
  15. type ReportAuthorResp struct {
  16. List []*ReportAuthor
  17. }