harem addition

This commit is contained in:
xiaomlove
2022-08-04 13:02:55 +08:00
parent 260ebd5a5e
commit 9be577cc81
12 changed files with 98 additions and 32 deletions
+17
View File
@@ -5730,4 +5730,21 @@ function calculate_seed_bonus($uid, $torrentIdArr = null): array
return $result;
}
function calculate_harem_addition($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['all_bonus'];
}
do_log("[HAREM_ADDITION], user: $uid, haremsCount: $haremsCount ,addition: $addition");
return $addition;
}
?>