info['testStats'], $user->info['testStats2']);
//exit();
$im = Db::getColumn("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'items_main'");
$iu = Db::getColumn("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'items_users'");
$u = Db::getColumn("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'users'");
$s = Db::getColumn("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'stats'");
$p = Db::getRows('select * from const_stats');
var_dump((new ShopOtdel())->getGroups());
?>
$user->[info]
info as $k => $v) {
if (isset($user->is[$k])) {
$k .= " [{$user->is[$k]}]";
}
if ($k == 'stats') {
echo 'stats = ARRAY
';
foreach (Conversion::dataStringToArray($v) as $dk => $dv) {
if (isset($user->is[$dk])) {
$dk .= " [{$user->is[$dk]}]";
}
echo "$dk = $dv
";
}
$k = '';
$v = '';
}
echo "$rr. $k = $v
";
$rr++;
}
?>
$user->[stats]
stats as $k => $v) {
if (isset($user->is[$k])) {
$k .= " [{$user->is[$k]}]";
} else {
$k = "$k";
}
echo "$rr. $k = $v
";
$rr++;
if (is_array($v)) {
foreach ($v as $k2 => $v2) {
echo "$k2 = $v2
";
if (is_array($v2)) {
foreach ($v2 as $k3 => $v3) {
echo "$k3 = $v3
";
if ($k3 === 'data' && $v3 !== '[]') {
$v3 .= '|add_mib2=43';
$itemData = Conversion::dataStringToArray($v3);
echo 'DATA TR_
';
foreach ((new Requirements($itemData))->get() as $k => $v) {
echo "$k = $v
";
}
echo 'DATA ADD_
';
foreach ((new Bonuses($itemData))->get() as $k => $v) {
echo "$k = $v
";
}
}
}
}
}
}
}
?>
Поля в базе users
Поля в базе stats
Отдельно, уже согласованные параметры предметов, которые могут находиться исключительно в поле data
Поля в базе items_main
Поля в базе items_users
Параметры игрока.
Заскриптованные
is); ?>
Хотим оставить
Хотим убрать
Текущая таблица параметров";
foreach ($p as $prow) {
echo "{$prow['sys_name']} → {$prow['name']}";
if ($prow['is_percentage']) {
echo " (%)";
}
if ($prow['is_requirement']) {
echo " [требуется] ";
}
if ($prow['is_bonus']) {
echo " [даёт] ";
}
echo "
";
}
$stats = Db::getRows('select id, stats from stats');
$sarr = [];
foreach ($stats as $stat) {
$data = Conversion::dataStringToArray($stat['stats']);
$arr = [
'uid' => $stat['id'],
's1' => $data['s1'] ?? 0,
's2' => $data['s2'] ?? 0,
's3' => $data['s3'] ?? 0,
's4' => $data['s4'] ?? 0,
's5' => $data['s5'] ?? 0,
's6' => $data['s6'] ?? 0,
's7' => $data['s7'] ?? 0,
'a1' => $data['a1'] ?? 0,
'a2' => $data['a2'] ?? 0,
'a3' => $data['a3'] ?? 0,
'a4' => $data['a4'] ?? 0,
'mg1' => $data['mg1'] ?? 0,
'mg2' => $data['mg2'] ?? 0,
'mg3' => $data['mg3'] ?? 0,
'mg4' => $data['mg4'] ?? 0,
];
unset($data['s1'], $data['s2'], $data['s3'], $data['s4'], $data['s5'], $data['s6'], $data['s7'],
$data['a1'], $data['a2'], $data['a3'], $data['a4'],
$data['mg1'], $data['mg2'], $data['mg3'], $data['mg4']);
$arr['tails'] = Conversion::arrayToDataString($data);
$arr['tails_json'] = json_encode($data);
$sarr[] = $arr;
}
var_dump($sarr);