минус один вложенный запрос
This commit is contained in:
parent
3fffebe667
commit
faf9e6e4a9
@ -17,15 +17,10 @@ class nick
|
||||
{
|
||||
if (!$this->user_data) {
|
||||
$user = db::c()->query('
|
||||
SELECT
|
||||
`login`,
|
||||
`level`,
|
||||
`align`,
|
||||
(SELECT `short` FROM `clans` WHERE `clans`.`id` = `klan`) AS `klan`,
|
||||
(SELECT 1 FROM `effects` WHERE `owner` = `users`.`id` AND `type` = 1022) AS `invis`,
|
||||
`hp`,
|
||||
`maxhp`
|
||||
FROM `users` WHERE `id` = ?i', $playerId)->fetch_assoc();
|
||||
SELECT `login`, `level`, U.`align`, `short`, (SELECT 1 FROM `effects` WHERE `owner` = U.`id` AND `type` = 1022) AS `invis`, U.`hp`, `maxhp`
|
||||
FROM `users` U
|
||||
LEFT JOIN `clans` C ON C.`id` = `klan`
|
||||
WHERE U.`id` = ?i', $playerId)->fetch_assoc();
|
||||
$this->user_data = $user;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user