23 lines
1.1 KiB
Go
23 lines
1.1 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// ReferralBinding 对应表 referral_bindings
|
|
type ReferralBinding struct {
|
|
ID string `gorm:"column:id;primaryKey;size:50"`
|
|
ReferrerID string `gorm:"column:referrer_id;size:50"`
|
|
RefereeID string `gorm:"column:referee_id;size:50"`
|
|
ReferralCode string `gorm:"column:referral_code;size:20"`
|
|
Status *string `gorm:"column:status;size:20"`
|
|
BindingDate time.Time `gorm:"column:binding_date"`
|
|
ExpiryDate time.Time `gorm:"column:expiry_date"`
|
|
CommissionAmount *float64 `gorm:"column:commission_amount;type:decimal(10,2)"`
|
|
PurchaseCount *int `gorm:"column:purchase_count"` // 购买次数
|
|
TotalCommission *float64 `gorm:"column:total_commission;type:decimal(10,2)"` // 累计佣金
|
|
LastPurchaseDate *time.Time `gorm:"column:last_purchase_date"` // 最后购买日期
|
|
CreatedAt time.Time `gorm:"column:created_at"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at"`
|
|
}
|
|
|
|
func (ReferralBinding) TableName() string { return "referral_bindings" }
|