| 1234567891011121314151617181920212223242526272829303132333435 |
- package entity
- // DtBalanceLog 余额流水表
- type DtBalanceLog struct {
- MysqlBaseModel
- UserId int64 `json:"userId" gorm:"index:idx_user_id;comment:用户ID"`
- Type int8 `json:"type" gorm:"index:idx_type;comment:类型: 1=任务收入 2=返佣收入 4=直推奖励 99=提现退回 100=提现扣款"`
- Amount float64 `json:"amount" gorm:"type:decimal(18,2);comment:变动金额"`
- BeforeBalance float64 `json:"beforeBalance" gorm:"type:decimal(18,2);comment:变动前余额"`
- AfterBalance float64 `json:"afterBalance" gorm:"type:decimal(18,2);comment:变动后余额"`
- RelatedId int64 `json:"relatedId" gorm:"comment:关联ID(任务ID/提现ID等)"`
- Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"`
- }
- func (*DtBalanceLog) TableName() string {
- return "dt_balance_log"
- }
- func (*DtBalanceLog) Comment() string {
- return "余额流水表"
- }
- func NewDtBalanceLog() *DtBalanceLog {
- return &DtBalanceLog{}
- }
- // 余额变动类型
- const (
- BalanceLogTypeTaskIncome = 1 // 任务收入
- BalanceLogTypeCommission = 2 // 返佣收入
- BalanceLogTypeInviteReward = 4 // 直推奖励
- BalanceLogTypeSignReward = 5 // 签到奖励
- BalanceLogTypeWithdrawBack = 99 // 提现退回
- BalanceLogTypeWithdraw = 100 // 提现扣款
- )
|