game/test1.php

37 lines
1.0 KiB
PHP

<?php
use Insallah\Db;
const GAME = 1;
require_once '_incl_data/__config.php';
//$getBotsQuery = 'select * from stats left join users on stats.id = users.id where bot = 2 and level = 8';
//$botUsers = Db::getRows($getBotsQuery);
$getBotsQuery = 'select * from stats left join users on stats.id = users.id where bot = 2 and exp >= ? and exp < ?';
$botUsers = Db::getRows($getBotsQuery, [300000,3000000]);
print_r($botUsers);
for ($i = 0; $i < 2; $i++) {
shuffle($botUsers);
$botInfo = array_shift($botUsers);
$botData = [
'id' => $botInfo['id'],
'login' => $botInfo['login'],
'level' => $botInfo['level'],
'city' => $botInfo['city'],
'cityreg' => $botInfo['city'],
'name' => $botInfo['login'],
'sex' => $botInfo['sex'],
'time_reg' => time(),
'obraz' => $botInfo['obraz'],
'stats' => $botInfo['stats'],
'upLevel' => $botInfo['upLevel'],
'priems' => $botInfo['priems'],
'loclon' => true,
];
echo '<pre>';
print_r($botData);
}