From 30776b55f0741dde2b54430eebeb100238162b8a Mon Sep 17 00:00:00 2001 From: jau1 <95550641@163.com> Date: Mon, 22 Jan 2024 18:39:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/redemption.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/redemption.go b/model/redemption.go index 2dbfa9fd..5455ece1 100644 --- a/model/redemption.go +++ b/model/redemption.go @@ -88,8 +88,8 @@ func Redeem(key string, userId int) (quota int, err error) { return 0, errors.New("兑换失败," + err.Error()) } RecordLog(userId, LogTypeTopup, fmt.Sprintf("通过兑换码充值 %s", common.LogQuota(redemption.Quota))) - if user.InviterId != 0 { - RecordLog(user.InviterId, LogTypeSale, fmt.Sprintf("通过分销赠送 %s", extendQuota)) + if user.InviterId != 0 && extendQuota > 0 { + RecordLog(user.InviterId, LogTypeSale, fmt.Sprintf("通过分销赠送 %s", common.LogQuota(int(float64(redemption.Quota)*common.GetSaleRatio(user.Group))))) } return redemption.Quota, nil }