Всё крашилось из-за отсутствия подарочных предметов в магазине.

This commit is contained in:
Ivor Barhansky 2023-07-03 20:31:59 +03:00
parent b055071e2e
commit c2eae44401

View File

@ -186,7 +186,6 @@ class Register
private function setStatsItemsEffects($uid)
{
$u = User::start();
if ($_SESSION['ref'] === 1) {
$this->classBonuses[$this->class]['items'][] = 4811;
}
@ -199,11 +198,12 @@ class Register
]
);
//fixme проверять предмет на существование!
foreach ($this->classBonuses[$this->class]['items'] as $item) {
$itemId = \User\ItemsModel::addItem($item, $uid);
$itemId = ItemsModel::addItem($item, $uid);
Db::sql(
'update items_users
set `1price` = (select price_1 from items_shop where items_shop.item_id = ? and sid = 1)
set `1price` = (select price_1 from items_main where items_main.item_id = ? and sid = 1)
where id = ?',
[$item, $itemId]
);