english_report_email_pv.go 956 B

123456789101112131415161718192021222324252627282930313233343536
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // EnglishReportEmailPV 英文研报-邮箱pv
  7. type EnglishReportEmailPV struct {
  8. Id int `orm:"column(id);pk"`
  9. ReportId int `description:"英文报告ID"`
  10. EmailId int `description:"邮箱ID"`
  11. CreateTime time.Time `description:"创建时间"`
  12. }
  13. func (item *EnglishReportEmailPV) TableName() string {
  14. return "english_report_email_pv"
  15. }
  16. func (item *EnglishReportEmailPV) Create() (err error) {
  17. o := orm.NewOrmUsingDB("rddp")
  18. id, err := o.Insert(item)
  19. if err != nil {
  20. return
  21. }
  22. item.Id = int(id)
  23. return
  24. }
  25. // InsertTrialEnglishReportEmailPV ETA试用平台-新增英文邮箱PV
  26. func InsertTrialEnglishReportEmailPV(item *EnglishReportEmailPV) (err error) {
  27. o := orm.NewOrmUsingDB("rddp_trial")
  28. sql := `INSERT INTO english_report_email_pv VALUE(?, ?, ?)`
  29. _, err = o.Raw(sql, item.ReportId, item.EmailId, item.CreateTime).Exec()
  30. return
  31. }