mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
calculate bonus group by torrent_id and peer_id
This commit is contained in:
@@ -704,7 +704,7 @@ class TrackerRepository extends BaseRepository
|
|||||||
'downloaded_increment' => $realDownloaded,
|
'downloaded_increment' => $realDownloaded,
|
||||||
'downloaded_increment_for_user' => $realDownloaded * $downRatio,
|
'downloaded_increment_for_user' => $realDownloaded * $downRatio,
|
||||||
];
|
];
|
||||||
do_log("$log, result: " . json_encode($result));
|
do_log("$log, result: " . json_encode($result), 'alert');
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5530,7 +5530,7 @@ function calculate_seed_bonus($uid): array
|
|||||||
$A = 0;
|
$A = 0;
|
||||||
$count = $torrent_count = 0;
|
$count = $torrent_count = 0;
|
||||||
|
|
||||||
$torrentres = sql_query("select torrents.added, torrents.size, torrents.seeders from torrents LEFT JOIN peers ON peers.torrent = torrents.id WHERE peers.userid = $uid AND peers.seeder ='yes' group by torrents.id");
|
$torrentres = sql_query("select torrents.added, torrents.size, torrents.seeders from torrents LEFT JOIN peers ON peers.torrent = torrents.id WHERE peers.userid = $uid AND peers.seeder ='yes' group by torrents.id, peers.peer_id");
|
||||||
while ($torrent = mysql_fetch_array($torrentres))
|
while ($torrent = mysql_fetch_array($torrentres))
|
||||||
{
|
{
|
||||||
$weeks_alive = ($timenow - strtotime($torrent['added'])) / $sectoweek;
|
$weeks_alive = ($timenow - strtotime($torrent['added'])) / $sectoweek;
|
||||||
|
|||||||
Reference in New Issue
Block a user