video_audit.go 654 B

123456789101112131415161718192021
  1. package archive
  2. import (
  3. "go-common/library/database/sql"
  4. "go-common/library/log"
  5. )
  6. const (
  7. _inAuditSQL = "INSERT INTO archive_video_audit (vid,aid,tid,oname,note,reason,passtime) VALUES (?,?,?,?,?,?,now()) ON DUPLICATE KEY UPDATE tid=?,oname=?,note=?,reason=?,passtime=now()"
  8. )
  9. // TxAddAudit insert video audit
  10. func (d *Dao) TxAddAudit(tx *sql.Tx, aid, vid, tagID int64, oname, note, reason string) (rows int64, err error) {
  11. res, err := tx.Exec(_inAuditSQL, vid, aid, tagID, oname, note, reason, tagID, oname, note, reason)
  12. if err != nil {
  13. log.Error("d.TxAddAudit.tx.Exec error(%v)", err)
  14. return
  15. }
  16. rows, err = res.RowsAffected()
  17. return
  18. }