refactor
This commit is contained in:
@@ -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']) {
|
||||
|
||||
Reference in New Issue
Block a user