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

38 lines
2.5 KiB

5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const UserRefundTableName = TableNamePrefix + "user_refund"
  7. type UserRefund struct {
  8. Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"`
  9. GoodType int `json:"good_type" xorm:"not null default(0) comment('1霸屏2打赏')"`
  10. RefundDesc string `json:"refund_desc" xorm:"not null default('') comment('') VARCHAR(128)"`
  11. WxRefundId string `json:"wx_refund_id" xorm:"not null default '' comment('微信退单号') VARCHAR(32)"`
  12. TransactionId string `json:"transaction_id" xorm:"not null default '' comment('微信订单号')"`
  13. OutTradeNo string `json:"out_trade_no" xorm:"not null default '' comment('商户订单号') VARCHAR(32)"`
  14. FeeType string `json:"fee_type" xorm:"not null default 'CNY' comment('货币种类') VARCHAR(16)"`
  15. TotalFee int `json:"total_fee" xorm:"not null default 0 comment('订单总金额,单位是分') INT(88)"`
  16. OpenId string `json:"open_id" xorm:"not null default '' comment('用户标识') VARCHAR(128)"`
  17. UserId int64 `json:"user_id" xorm:"not null default 0 comment('用户id') INT(11)"`
  18. ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"`
  19. RefundStatus string `json:"refund_status" xorm:"not null default '' comment('微信退款状态') VARCHAR(16)"`
  20. Status int `json:"status" xorm:"not null default 0 comment('0未查询,1已查询') TINYINT(1)"`
  21. SuccessTime string `json:"success_time" xorm:"not null default '' comment('退款成功时间') VARCHAR(20)"`
  22. RefundRecvAccount string `json:"refund_recv_account" xorm:"not null default '' comment('入账账号') VARCHAR(64)"`
  23. RefundAccount string `json:"refund_account" xorm:"not null default '' comment('入账账号') VARCHAR(64)"`
  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 *UserRefund) TableName() string {
  29. return UserRefundTableName
  30. }
  31. func (t *UserRefund) GetByOutRefundNo(no string) (bool, error) {
  32. return core.GetXormAuto().Where("is_delete=0 and out_refund_no=?", no).Get(t)
  33. }