This commit is contained in:
@@ -575,10 +575,18 @@ func (l *ActivateOrderLogic) extendGiftSubscription(ctx context.Context, giftSub
|
||||
// This runs asynchronously to avoid blocking the main order processing flow.
|
||||
func (l *ActivateOrderLogic) handleCommission(ctx context.Context, userInfo *user.User, orderInfo *order.Order) {
|
||||
if !l.shouldProcessCommission(userInfo, orderInfo.IsNew) {
|
||||
l.grantGiftDaysToBothParties(ctx, userInfo, orderInfo.OrderNo)
|
||||
// 普通用户路径(佣金比例=0):只有首单才双方赠N天
|
||||
if orderInfo.IsNew {
|
||||
l.grantGiftDaysToBothParties(ctx, userInfo, orderInfo.OrderNo)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 渠道路径(佣金比例>0):被邀请人首单赠N天
|
||||
if orderInfo.IsNew {
|
||||
_ = l.grantGiftDays(ctx, userInfo, int(l.svc.Config.Invite.GiftDays), orderInfo.OrderNo, "邀请赠送")
|
||||
}
|
||||
|
||||
referer, err := l.svc.UserModel.FindOne(ctx, userInfo.RefererId)
|
||||
if err != nil {
|
||||
logger.WithContext(ctx).Error("Find referer failed",
|
||||
|
||||
Reference in New Issue
Block a user