game/adminion/sms.php

19 lines
898 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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);