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

39 lines
2.4 KiB

5 years ago
5 years ago
5 years ago
5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const UserRedPackTableName = TableNamePrefix + "user_red_pack"
  7. // todo: 红包号码
  8. type UserRedPack struct {
  9. Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"`
  10. MchBillno string `json:"mch_billno" xorm:"not null default('') comment('商户订单号') VARCHAR(28)"`
  11. SendName string `json:"send_name" xorm:"not null default('') comment('商户名称') VARCHAR(32)"`
  12. ReOpenid string `json:"re_openid" xorm:"not null default '' comment('接收红包用户openid') VARCHAR(32)"`
  13. TotalAmount int `json:"total_amount" xorm:"not null default 0 comment('付款金额, 单位分') INT(11)"`
  14. TotalNum int `json:"total_num" xorm:"not null default 0 comment('红包发放总人数') INT(11)"`
  15. SceneId int `json:"scene_id" xorm:"not null default 0 comment('场景id') INT(11)"`
  16. SendListid string `json:"send_listid" xorm:"not null default '' comment('红包订单的微信单号') VARCHAR(32)"`
  17. Status string `json:"status" xorm:"not null default '' comment('红包状态') VARCHAR(16)"`
  18. HbType string `json:"hb_type" xorm:"not null default '' comment('红包类型') VARCHAR(32)"`
  19. Reason string `json:"reason" xorm:"not null default '' comment('失败原因') VARCHAR(32)"`
  20. SendTime string `json:"send_time" xorm:"not null default '' comment('红包发送时间') VARCHAR(32)"`
  21. RefundTime string `json:"refund_time" xorm:"not null default '' comment('红包退款时间') VARCHAR(32)"`
  22. RefundAmount string `json:"refund_amount" xorm:"not null default '' comment('红包退款金额') VARCHAR(32)"`
  23. UserId int64 `json:"user_id" xorm:"not null default 0 comment('用户id') INT(11)"`
  24. ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"`
  25. IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('是否删除') TINYINT(1)" description:"是否删除"`
  26. CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME" description:"创建时间"`
  27. UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME" description:"更新时间"`
  28. }
  29. func (t *UserRedPack) TableName() string {
  30. return UserRedPackTableName
  31. }
  32. func (t *UserRedPack) AddRedPack() (int64, error) {
  33. return core.GetXormAuto().InsertOne(t)
  34. }