恢复被删除的代码

This commit is contained in:
Alex-larget
2026-02-25 11:52:11 +08:00
parent 1f9eee0fd7
commit 44f995a5a3
77 changed files with 10340 additions and 6 deletions

View File

@@ -0,0 +1,22 @@
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" }