mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
add seed_points_per_hour + improve calculateUserSeedBonus
This commit is contained in:
@@ -6075,18 +6075,26 @@ function calculate_seed_bonus($uid, $torrentIdArr = null): array
|
||||
|
||||
function calculate_harem_addition($uid)
|
||||
{
|
||||
$harems = \App\Models\User::query()
|
||||
->where('invited_by', $uid)
|
||||
// $harems = \App\Models\User::query()
|
||||
// ->where('invited_by', $uid)
|
||||
// ->where('status', \App\Models\User::STATUS_CONFIRMED)
|
||||
// ->where('enabled', \App\Models\User::ENABLED_YES)
|
||||
// ->get(['id']);
|
||||
// $addition = 0;
|
||||
// $haremsCount = $harems->count();
|
||||
// foreach ($harems as $harem) {
|
||||
// $result = calculate_seed_bonus($harem->id);
|
||||
// $addition += $result['seed_points'];
|
||||
// }
|
||||
// do_log("[HAREM_ADDITION], user: $uid, haremsCount: $haremsCount ,addition: $addition");
|
||||
|
||||
$addition = \Nexus\Database\NexusDB::table("users")
|
||||
->where("invited_by", $uid)
|
||||
->where('status', \App\Models\User::STATUS_CONFIRMED)
|
||||
->where('enabled', \App\Models\User::ENABLED_YES)
|
||||
->get(['id']);
|
||||
$addition = 0;
|
||||
$haremsCount = $harems->count();
|
||||
foreach ($harems as $harem) {
|
||||
$result = calculate_seed_bonus($harem->id);
|
||||
$addition += $result['seed_points'];
|
||||
}
|
||||
do_log("[HAREM_ADDITION], user: $uid, haremsCount: $haremsCount ,addition: $addition");
|
||||
->sum("seed_points_per_hour")
|
||||
;
|
||||
do_log("[HAREM_ADDITION], user: $uid, addition: $addition");
|
||||
return $addition;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user