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