This commit is contained in:
2023-07-28 01:25:38 +03:00
parent 74b644fe59
commit cffcf57031
7 changed files with 305 additions and 335 deletions
+10 -9
View File
@@ -84,21 +84,22 @@ class FightRequest
);
foreach ($sp as $pl) {
$uz = Db::getRow(
'select users.id, * from users left join stats on users.id = stats.id where zv = ?',
'select * from users left join stats on users.id = stats.id where zv = ?',
[$pl['id']]
);
$i = [];
$toChat = '';
$toWhere = '';
foreach ($uz as $t) {
${'tm' . $t['team']} ??= [];
$i[$t['team']] ??= 0;
${'tm' . $t['team']}[$i[$t['team']]] = $t;
$toChat .= '' . $t['login'] . ',';
$toWhere .= 'OR `id` = "' . $t['id'] . '" ';
$i[$t['team']]++;
if (is_iterable($uz)) {
foreach ($uz as $t) {
${'tm' . $t['team']} ??= [];
$i[$t['team']] ??= 0;
${'tm' . $t['team']}[$i[$t['team']]] = $t;
$toChat .= '' . $t['login'] . ',';
$toWhere .= 'OR `id` = "' . $t['id'] . '" ';
$i[$t['team']]++;
}
}
if ($pl['razdel'] == self::BATTLE_RAZDEL_CHAOTIC) {
$cols = $this->countUsersAll($pl['id']);
if ($cols >= $pl['maxplayers']) {