From 7159a46ef4bef0571ee764f1716ec52ffdec20f5 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 29 Oct 2024 23:41:06 +0800 Subject: [PATCH] fix doner bonus increament --- include/functions.php | 2 +- include/globalfunctions.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/functions.php b/include/functions.php index 935f6a20..5c2e4983 100644 --- a/include/functions.php +++ b/include/functions.php @@ -6315,7 +6315,7 @@ function build_bonus_table(array $user, array $bonusResult = [], array $options $isDonor = is_donor($user); $donortimes_bonus = get_setting('bonus.donortimes'); $baseBonusFactor = 1; - if ($isDonor) { + if ($isDonor && $donortimes_bonus != 0) { $baseBonusFactor = $donortimes_bonus; } $baseBonus = $bonusResult['seed_bonus'] * $baseBonusFactor; diff --git a/include/globalfunctions.php b/include/globalfunctions.php index dbb18a3b..db89a5d3 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -937,13 +937,13 @@ function getDataTraffic(array $torrent, array $queries, array $user, $peer, $sna } $uploaderRatio = get_setting('torrent.uploaderdouble'); $log .= ", uploaderRatio: $uploaderRatio"; - if ($torrent['owner'] == $user['id']) { + if ($torrent['owner'] == $user['id'] && $uploaderRatio != 1) { //uploader, use the bigger one $upRatio = max($uploaderRatio, \App\Models\Torrent::$promotionTypes[$spStateReal]['up_multiplier']); - $log .= ", [IS_UPLOADER], upRatio: $upRatio"; + $log .= ", [IS_UPLOADER] && uploaderRatio != 1, upRatio: $upRatio"; } else { $upRatio = \App\Models\Torrent::$promotionTypes[$spStateReal]['up_multiplier']; - $log .= ", [IS_NOT_UPLOADER], upRatio: $upRatio"; + $log .= ", [IS_NOT_UPLOADER] || uploaderRatio == 1, upRatio: $upRatio"; } /** * VIP do not calculate downloaded