From c6f86632ef8098a3acd589e53135050043084318 Mon Sep 17 00:00:00 2001 From: lopar Date: Mon, 14 Jan 2019 20:45:58 +0200 Subject: [PATCH] do not query shop items on when selling something --- shop.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/shop.php b/shop.php index 0be1493..3183b32 100644 --- a/shop.php +++ b/shop.php @@ -178,7 +178,8 @@ switch ($shopCategoryTypeNumber) { break; } -$shopItems = db::c()->query('SELECT `shop`.*, +if (false == $saleItems) { + $shopItems = db::c()->query('SELECT `shop`.*, `magic`.`name` AS `magic_name`, `magic`.`chanse` AS `magic_chanse`, `magic`.`time` AS `magic_time`, @@ -189,11 +190,11 @@ $shopItems = db::c()->query('SELECT `shop`.*, FROM `shop` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `count` > 0 AND `cost` > 0 AND `razdel` = ?i ORDER by `nlevel` ASC, `id` ASC', $shopCategoryTypeNumber); -$iteminfo = []; -while ($row = $shopItems->fetch_assoc()) { - $iteminfo[] = new ShopItem($row); + $iteminfo = []; + while ($row = $shopItems->fetch_assoc()) { + $iteminfo[] = new ShopItem($row); + } } - ?>