order_report.go 734 B

12345678910111213141516171819202122
  1. package dao
  2. import (
  3. "go-common/app/admin/ep/melloi/model"
  4. )
  5. // AddReport add manual report
  6. func (d *Dao) AddReport(report *model.OrderReport) (err error) {
  7. return d.DB.Model(&model.OrderReport{}).Create(report).Error
  8. }
  9. // QueryReportByOrderID query report by order id
  10. func (d *Dao) QueryReportByOrderID(orderID int64) (report *model.OrderReport, err error) {
  11. report = &model.OrderReport{}
  12. err = d.DB.Table(model.OrderReport{}.TableName()).Where("order_id=? ", orderID).Find(&report).Error
  13. return
  14. }
  15. // UpdateReportByID update report by id
  16. func (d *Dao) UpdateReportByID(report *model.OrderReport) error {
  17. return d.DB.Table(model.OrderReport{}.TableName()).Where("ID=?", report.ID).Update("content", report.Content).Error
  18. }