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

33 lines
1.2 KiB

5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const OrderDrawActivityTableName = TableNamePrefix + "order_draw_activity"
  7. //订单抽奖活动
  8. type OrderDrawActivity struct {
  9. Id int64 `json:"id"`
  10. ActivityId int64 `json:"activity_id" description:"活动的id"`
  11. CreatorId int64 `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 int64) ([]int64, error) {
  24. orderIds := make([]int64, 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. }