互动
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.

34 lines
1.3 KiB

5 years ago
5 years ago
5 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. package models
  2. import (
  3. "time"
  4. "github.com/ouxuanserver/osmanthuswine/src/core"
  5. )
  6. const OrderDrawActivityTableName = TableNamePrefix + "order_draw_activity"
  7. //订单抽奖活动
  8. type OrderDrawActivity struct {
  9. Id int `json:"id" xorm:"not null autoincr pk INT(11)`
  10. ActivityId int `json:"activity_id" description:"活动的id"`
  11. CreatorId int `json:"creator_id"`
  12. OrderDrawActivityName string `json:"order_draw_activity_name"`
  13. OrderDrawRule *OrderDrawRule `json:"order_draw_rule" xorm:"-"`
  14. MoreAreaMode string `json:"more_area_mode"`
  15. IsSuccess bool `json:"is_success"`
  16. IsDelete bool `json:"is_delete" xorm:"default(0)"`
  17. CreatedAt time.Time `json:"-" xorm:"created" description:"创建时间"`
  18. UpdatedAt time.Time `json:"-" xorm:"updated" description:"更新时间"`
  19. }
  20. func (t *OrderDrawActivity) TableName() string {
  21. return OrderDrawActivityTableName
  22. }
  23. func GetODActivityIdsByActivityId(aid int) ([]int, error) {
  24. orderIds := make([]int, 0)
  25. err := core.GetXormAuto().Table(new(OrderDrawActivity)).Select("id").
  26. Where("is_delete=0 and activity_id=?", aid).Find(&orderIds)
  27. return orderIds, err
  28. }