reason_log.go 617 B

12345678910111213141516171819202122
  1. package manager
  2. import (
  3. "context"
  4. "go-common/library/log"
  5. "time"
  6. )
  7. const (
  8. _inLogSQL = "INSERT INTO reason_log (oid, type, category_id, reason_id, uid, typeid, ctime, mtime) VALUES (?,?,?,?,?,?,?,?)"
  9. )
  10. // AddReasonLog add a reason log
  11. func (d *Dao) AddReasonLog(c context.Context, oid int64, tp int8, cateID int64, rid int64, uid int64, tid int16, ctime, mtime time.Time) (rows int64, err error) {
  12. res, err := d.managerDB.Exec(c, _inLogSQL, oid, tp, cateID, rid, uid, tid, ctime, mtime)
  13. if err != nil {
  14. log.Error("d.AddReasonLog.Exec error(%v)", err)
  15. return
  16. }
  17. rows, err = res.RowsAffected()
  18. return
  19. }