19 lines
898 B
PHP
19 lines
898 B
PHP
|
<?php
|
|||
|
|
|||
|
use Core\Db;
|
|||
|
use Helper\Table;
|
|||
|
|
|||
|
if (!defined('GAME_VERSION')) {
|
|||
|
require_once '_incl_data/autoload.php';
|
|||
|
}
|
|||
|
|
|||
|
$users = Db::getRows('select users.id, money, money2 from users inner join stats on users.id = stats.id where `real` > 0 and banned = 0 and bot = 0 order by id desc');
|
|||
|
$tbl = [['Логин', 'Стоимость вещей кр', 'Стоимость вещей екр', 'Всего кр с учётом вещей', 'Всего екр с учётом вещей']];
|
|||
|
foreach ($users as $user) {
|
|||
|
$itemsprices = Db::getRow('select sum(`1price`) as sumkr, sum(`2price`) as sumekr from items_users where uid = ?', [$user['id']]);
|
|||
|
$allkr = $user['money'] + $itemsprices['sumkr'];
|
|||
|
$allekr = $user['money2'] + $itemsprices['sumekr'];
|
|||
|
$tbl[] = [User::getLogin($user['id']), $itemsprices['sumkr'] ?? 0, $itemsprices['sumekr'] ?? 0, $allkr, $allekr];
|
|||
|
}
|
|||
|
echo Table::get($tbl);
|