12345678910111213141516171819202122232425 |
- package models
- import "rdluck_tools/orm"
- type Report struct {
- Id int
- Content string
- ContentSub string
- }
- func GetReport() (items []*Report, err error) {
- sql := `SELECT * FROM report ORDER BY id ASC `
- o := orm.NewOrm()
- o.Using("rddp")
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
- func ModifyReportContentSub(id int, contentSub string) (err error) {
- sql := `UPDATE report SET content_sub=? WHERE id=? `
- o := orm.NewOrm()
- o.Using("rddp")
- _, err = o.Raw(sql, contentSub, id).Exec()
- return
- }
|