Админка: отображение невидимок уехало в новый класс. Отвязка от functions.php.

This commit is contained in:
2022-06-11 02:17:24 +03:00
parent bcd864d638
commit 4bd6a08e8a
3 changed files with 24 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace Battles\Admin;
use Battles\Database\Db;
class User
{
private const INVISIBILITY_EFFECT = 1022;
public static function getInvisiblesList(): string
{
$list = '';
$row = Db::getInstance()->ofetchAll('select id, login from users left join users_effects ue on users.id = ue.owner_id where type = ' . self::INVISIBILITY_EFFECT);
foreach ($row as $item) {
$list .= '[id] = ' . $item->id . ', ' . $item->login . '<br>';
}
return $list;
}
}