activity_vivo_points_set.go 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxActivityVivoPointsSet struct {
  7. PointSetId int `orm:"column(point_set_id);pk";comment:"主键id"`
  8. ActivityId int `comment:"活动ID"`
  9. PointsObject string `comment:"扣点设置方式 1:同报名参会时的扣点数、2:输入其余点数"`
  10. PointsNum float64 `comment:"扣点数量"`
  11. GoodsMoney float64 `comment:"商品总价"`
  12. Source string `comment:"来源 activityvideo 活动视频、activityvoice 活动音频"`
  13. CreateTime time.Time `comment:"创建时间"`
  14. ModifyTime time.Time `comment:"更新时间"`
  15. }
  16. // 根据活动ID判断音视频是否设置了扣点
  17. func GetCygxActivityVivoPointsSetCountByActivityId(activityId int) (count int, err error) {
  18. o := orm.NewOrm()
  19. sqlCount := ` SELECT COUNT(1) AS count FROM cygx_activity_vivo_points_set WHERE activity_id =? `
  20. err = o.Raw(sqlCount, activityId).QueryRow(&count)
  21. return
  22. }
  23. func GetCygxActivityVivoPointsSetByActivityId(activityId int) (item *CygxActivityVivoPointsSet, err error) {
  24. o := orm.NewOrm()
  25. sql := `SELECT * FROM cygx_activity_vivo_points_set WHERE activity_id = ? `
  26. err = o.Raw(sql, activityId).QueryRow(&item)
  27. return
  28. }