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