activity_vivo_point_record.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. //活动音视频,首次播放扣点记录
  7. type CygxActivityVivoPointRecord struct {
  8. RecordId int `orm:"column(record_id);pk";comment:"主键ID"`
  9. SourceId int `comment:"来源ID"`
  10. Source string `comment:"来源 activityvoice:活动音频、activityvideo:活动视频"`
  11. UserId int `comment:"用户ID"`
  12. Mobile string `comment:"手机号"`
  13. Email string `comment:"邮箱"`
  14. CompanyId int `comment:"公司ID"`
  15. CompanyName string `comment:"公司名称"`
  16. RealName string `comment:"用户实际名称"`
  17. SellerName string `comment:"所属销售"`
  18. CreateTime time.Time `comment:"创建时间"`
  19. ModifyTime time.Time `comment:"修改时间"`
  20. RegisterPlatform int `comment:"来源 1小程序,2:网页"`
  21. }
  22. // GetCygxActivityVivoPointRecordCount 查询用户是否扣过点
  23. func GetCygxActivityVivoPointRecordCount(sourceId, userId int) (count int, err error) {
  24. o := orm.NewOrm()
  25. sql := `SELECT COUNT(1) count FROM cygx_activity_vivo_point_record WHERE source_id = ? AND user_id = ? `
  26. err = o.Raw(sql, sourceId, userId).QueryRow(&count)
  27. return
  28. }
  29. // 添加
  30. func AddCygxActivityVivoPointRecord(item *CygxActivityVivoPointRecord) (err error) {
  31. o := orm.NewOrm()
  32. _, err = o.Insert(item)
  33. return
  34. }