diff --git a/app/Jobs/CalculateUserSeedBonus.php b/app/Jobs/CalculateUserSeedBonus.php index a90fb5e3..8bfa838e 100644 --- a/app/Jobs/CalculateUserSeedBonus.php +++ b/app/Jobs/CalculateUserSeedBonus.php @@ -121,9 +121,9 @@ public function handle() // $sql = "update users set seed_points = ifnull(seed_points, 0) + $seed_points, seed_points_per_hour = {$seedBonusResult['seed_points']}, seedbonus = seedbonus + $all_bonus, seed_points_updated_at = '$updatedAt' where id = $uid limit 1"; // do_log("$bonusLog, query: $sql"); // NexusDB::statement($sql); - $seedPointsUpdates[] = sprintf("case %d then ifnull(seed_points, 0) + %d", $uid, $seed_points); - $seedPointsPerHourUpdates[] = sprintf("case %d then %d", $uid, $seedBonusResult['seed_points']); - $seedBonusUpdates[] = sprintf("case %d then %d", $uid, $all_bonus); + $seedPointsUpdates[] = sprintf("when %d then ifnull(seed_points, 0) + %d", $uid, $seed_points); + $seedPointsPerHourUpdates[] = sprintf("when %d then %d", $uid, $seedBonusResult['seed_points']); + $seedBonusUpdates[] = sprintf("when %d then %d", $uid, $all_bonus); if ($fd) { $log = sprintf( '%s|%s|%s|%s|%s|%s|%s|%s', diff --git a/app/Jobs/UpdateTorrentSeedersEtc.php b/app/Jobs/UpdateTorrentSeedersEtc.php index e2edcf8a..6b37083b 100644 --- a/app/Jobs/UpdateTorrentSeedersEtc.php +++ b/app/Jobs/UpdateTorrentSeedersEtc.php @@ -99,7 +99,7 @@ public function handle() ->groupBy(['torrent']) ->get(); foreach ($res as $row) { - $torrents[$row->torrent]["comments"] = $row["c"]; + $torrents[$row->torrent]["comments"] = $row->c; } $seedersUpdates = $leechersUpdates = $commentsUpdates = []; foreach ($torrentIdArr as $id) { diff --git a/include/functions.php b/include/functions.php index ba674425..03d49362 100644 --- a/include/functions.php +++ b/include/functions.php @@ -6084,7 +6084,7 @@ function calculate_seed_bonus($uid, $torrentIdArr = null): array do_log(sprintf( "$logPrefix, torrent: %s, peer ID: %s, weeks: %s, size_raw: %s GB, size: %s GB, increase A: %s, increase official A: %s", $torrent['id'], $torrent['peerID'], $weeks_alive, $gb_size_raw, $gb_size, $temp, $officialAIncrease - )); + ), "debug"); } if ($count > $maxseeding_bonus) $count = $maxseeding_bonus; diff --git a/resources/views/filament/widgets/stat-table.blade.php b/resources/views/filament/widgets/stat-table.blade.php index 770b861b..b3a8ed2e 100644 --- a/resources/views/filament/widgets/stat-table.blade.php +++ b/resources/views/filament/widgets/stat-table.blade.php @@ -20,7 +20,7 @@ colspan="3" @endif > -