feedback.go 601 B

123456789101112131415161718192021222324
  1. package academy
  2. import (
  3. "context"
  4. "go-common/app/interface/main/creative/model/academy"
  5. "go-common/library/log"
  6. )
  7. const (
  8. // insert
  9. _inFbSQL = "INSERT IGNORE INTO academy_feedback (category, course, suggest, ctime, mtime, mid) VALUES (?,?,?,?,?,?)"
  10. )
  11. // AddFeedBack add academy_feedback.
  12. func (d *Dao) AddFeedBack(c context.Context, f *academy.FeedBack, mid int64) (id int64, err error) {
  13. res, err := d.db.Exec(c, _inFbSQL, f.Category, f.Course, f.Suggest, f.CTime, f.MTime, mid)
  14. if err != nil {
  15. log.Error("d.db.Exec error(%v)", err)
  16. return
  17. }
  18. id, err = res.LastInsertId()
  19. return
  20. }