mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
refactor: multiple calls to getVSumField() replaced by a single one
#313
This commit is contained in:
@@ -5250,9 +5250,19 @@ class Automation {
|
||||
$ally = $database->getAlliance($aid);
|
||||
$memberlist = $database->getAllMember($ally['id']);
|
||||
$oldrank = 0;
|
||||
|
||||
$memberIDs = [];
|
||||
foreach($memberlist as $member) {
|
||||
$oldrank += $database->getVSumField($member['id'],"pop");
|
||||
$memberIDs[] = $member['id'];
|
||||
}
|
||||
$data = $database->getVSumField($memberIDs,"pop");
|
||||
|
||||
if (count($data)) {
|
||||
foreach ($data as $row) {
|
||||
$oldrank += $row['Total'];
|
||||
}
|
||||
}
|
||||
|
||||
if($ally['oldrank'] != $oldrank){
|
||||
if($ally['oldrank'] < $oldrank) {
|
||||
$totalpoints = $oldrank - $ally['oldrank'];
|
||||
|
||||
Reference in New Issue
Block a user