dt_balance_log.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package entity
  2. // DtBalanceLog 余额流水表
  3. type DtBalanceLog struct {
  4. MysqlBaseModel
  5. UserId int64 `json:"userId" gorm:"index:idx_user_id;comment:用户ID"`
  6. Type int8 `json:"type" gorm:"index:idx_type;comment:类型: 1=任务收入 2=返佣收入 4=直推奖励 99=提现退回 100=提现扣款"`
  7. Amount float64 `json:"amount" gorm:"type:decimal(18,2);comment:变动金额"`
  8. BeforeBalance float64 `json:"beforeBalance" gorm:"type:decimal(18,2);comment:变动前余额"`
  9. AfterBalance float64 `json:"afterBalance" gorm:"type:decimal(18,2);comment:变动后余额"`
  10. RelatedId int64 `json:"relatedId" gorm:"comment:关联ID(任务ID/提现ID等)"`
  11. Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"`
  12. }
  13. func (*DtBalanceLog) TableName() string {
  14. return "dt_balance_log"
  15. }
  16. func (*DtBalanceLog) Comment() string {
  17. return "余额流水表"
  18. }
  19. func NewDtBalanceLog() *DtBalanceLog {
  20. return &DtBalanceLog{}
  21. }
  22. // 余额变动类型
  23. const (
  24. BalanceLogTypeTaskIncome = 1 // 任务收入
  25. BalanceLogTypeCommission = 2 // 返佣收入
  26. BalanceLogTypeInviteReward = 4 // 直推奖励
  27. BalanceLogTypeSignReward = 5 // 签到奖励
  28. BalanceLogTypeWithdrawBack = 99 // 提现退回
  29. BalanceLogTypeWithdraw = 100 // 提现扣款
  30. )