From 94c221dfbccad32a2b238761328fbfdf6cba0b91 Mon Sep 17 00:00:00 2001 From: lopar Date: Tue, 15 Jan 2019 01:05:01 +0200 Subject: [PATCH] error in money check --- shop.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shop.php b/shop.php index f5bd2f9..35fdf4f 100644 --- a/shop.php +++ b/shop.php @@ -122,7 +122,7 @@ if ($sellItemId) { $allcost = mt_rand(0,$dress['cost']/2); db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $dress['id']); - db::c()->query('UPDATE `users` SET `money` = ?i WHERE `id` = ?i', $allcost, $_SESSION['uid']); + db::c()->query('UPDATE `users` SET `money` = `money` - ?i WHERE `id` = ?i', $allcost, $_SESSION['uid']); $status = "Вы продали «{$dress['name']}» $kols за " . $allcost . " кр."; $deloText = "{$user['login']} продал товар «{$dress['name']}»{$kols}id:({$dress['id']}) в магазине за {$allcost} кр."; addToDelo($deloText);