互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
971 B

5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
  1. package models
  2. import (
  3. "git.ouxuan.net/tommy/osmanthuswine/src/core"
  4. )
  5. const OrderDrawActivityTableName = TableNamePrefix + "order_draw_activity"
  6. //订单抽奖活动
  7. type OrderDrawActivity struct {
  8. Model `xorm:"extends"`
  9. ActivityId int `json:"activity_id" description:"活动的id"`
  10. CreatorId int `json:"creator_id"`
  11. OrderDrawActivityName string `json:"order_draw_activity_name"`
  12. OrderDrawRule *OrderDrawRule `json:"order_draw_rule" xorm:"-"`
  13. MoreAreaMode string `json:"more_area_mode"`
  14. IsSuccess bool `json:"is_success"`
  15. }
  16. func (t *OrderDrawActivity) TableName() string {
  17. return OrderDrawActivityTableName
  18. }
  19. func GetODActivityIdsByActivityId(aid int) ([]int, error) {
  20. orderIds := make([]int, 0)
  21. err := core.GetXormAuto().Table(new(OrderDrawActivity)).Select("id").
  22. Where("is_delete=0 and activity_id=?", aid).Find(&orderIds)
  23. return orderIds, err
  24. }