删除分销中心和海报设计相关的同步报告及优化说明文档,清理不再使用的自动部署脚本,确保代码库整洁。更新小程序页面以动态获取绑定期和用户优惠信息,提升用户体验和灵活性。
This commit is contained in:
@@ -153,10 +153,12 @@ func ReferralData(c *gin.Context) {
|
||||
|
||||
db := database.DB()
|
||||
|
||||
// 获取分销配置
|
||||
// 获取分销配置(与 soul-admin 推广设置一致)
|
||||
distributorShare := 0.9
|
||||
minWithdrawAmount := 10.0
|
||||
|
||||
bindingDays := defaultBindingDays
|
||||
userDiscount := 5
|
||||
|
||||
var cfg model.SystemConfig
|
||||
if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil {
|
||||
var config map[string]interface{}
|
||||
@@ -167,6 +169,12 @@ func ReferralData(c *gin.Context) {
|
||||
if minAmount, ok := config["minWithdrawAmount"].(float64); ok {
|
||||
minWithdrawAmount = minAmount
|
||||
}
|
||||
if days, ok := config["bindingDays"].(float64); ok && days > 0 {
|
||||
bindingDays = int(days)
|
||||
}
|
||||
if discount, ok := config["userDiscount"].(float64); ok {
|
||||
userDiscount = int(discount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,6 +394,8 @@ func ReferralData(c *gin.Context) {
|
||||
"estimatedEarnings": round(estimatedEarnings, 2),
|
||||
"shareRate": int(distributorShare * 100),
|
||||
"minWithdrawAmount": minWithdrawAmount,
|
||||
"bindingDays": bindingDays,
|
||||
"userDiscount": userDiscount,
|
||||
|
||||
// 推荐码
|
||||
"referralCode": getStringValue(user.ReferralCode),
|
||||
|
||||
Reference in New Issue
Block a user