fix doner bonus increament

This commit is contained in:
xiaomlove
2024-10-29 23:41:06 +08:00
parent 7a29366978
commit 7159a46ef4
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -6315,7 +6315,7 @@ function build_bonus_table(array $user, array $bonusResult = [], array $options
$isDonor = is_donor($user); $isDonor = is_donor($user);
$donortimes_bonus = get_setting('bonus.donortimes'); $donortimes_bonus = get_setting('bonus.donortimes');
$baseBonusFactor = 1; $baseBonusFactor = 1;
if ($isDonor) { if ($isDonor && $donortimes_bonus != 0) {
$baseBonusFactor = $donortimes_bonus; $baseBonusFactor = $donortimes_bonus;
} }
$baseBonus = $bonusResult['seed_bonus'] * $baseBonusFactor; $baseBonus = $bonusResult['seed_bonus'] * $baseBonusFactor;
+3 -3
View File
@@ -937,13 +937,13 @@ function getDataTraffic(array $torrent, array $queries, array $user, $peer, $sna
} }
$uploaderRatio = get_setting('torrent.uploaderdouble'); $uploaderRatio = get_setting('torrent.uploaderdouble');
$log .= ", uploaderRatio: $uploaderRatio"; $log .= ", uploaderRatio: $uploaderRatio";
if ($torrent['owner'] == $user['id']) { if ($torrent['owner'] == $user['id'] && $uploaderRatio != 1) {
//uploader, use the bigger one //uploader, use the bigger one
$upRatio = max($uploaderRatio, \App\Models\Torrent::$promotionTypes[$spStateReal]['up_multiplier']); $upRatio = max($uploaderRatio, \App\Models\Torrent::$promotionTypes[$spStateReal]['up_multiplier']);
$log .= ", [IS_UPLOADER], upRatio: $upRatio"; $log .= ", [IS_UPLOADER] && uploaderRatio != 1, upRatio: $upRatio";
} else { } else {
$upRatio = \App\Models\Torrent::$promotionTypes[$spStateReal]['up_multiplier']; $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 * VIP do not calculate downloaded