report.go 516 B

12345678910111213141516171819202122232425
  1. package models
  2. import "rdluck_tools/orm"
  3. type Report struct {
  4. Id int
  5. Content string
  6. ContentSub string
  7. }
  8. func GetReport() (items []*Report, err error) {
  9. sql := `SELECT * FROM report ORDER BY id ASC `
  10. o := orm.NewOrm()
  11. o.Using("rddp")
  12. _, err = o.Raw(sql).QueryRows(&items)
  13. return
  14. }
  15. func ModifyReportContentSub(id int, contentSub string) (err error) {
  16. sql := `UPDATE report SET content_sub=? WHERE id=? `
  17. o := orm.NewOrm()
  18. o.Using("rddp")
  19. _, err = o.Raw(sql, contentSub, id).Exec()
  20. return
  21. }