Замена define на const. Отказ от дублирующих инициализаций переменных $user $db и вызовов классов User и DBPDO из-за ошибочно настроенной IDE.
This commit is contained in:
@@ -16,50 +16,35 @@ class ShopItem extends Item
|
||||
'sellshop' => 'Продать',
|
||||
'buyshop' => 'Купить',
|
||||
];
|
||||
private const BUY_QUERY = 'insert into inventory (owner_id, name, item_type, durability,
|
||||
need_strength, need_dexterity, need_intuition, need_endurance, need_intelligence, need_wisdom,
|
||||
add_strength, add_dexterity, add_intuition, add_endurance, add_intelligence, add_wisdom,
|
||||
add_accuracy, add_evasion, add_criticals, add_min_physical_damage, add_max_physical_damage,
|
||||
image, weight, price)
|
||||
select
|
||||
?,
|
||||
name,
|
||||
item_type,
|
||||
durability,
|
||||
need_strength,
|
||||
need_dexterity,
|
||||
need_intuition,
|
||||
need_endurance,
|
||||
need_intelligence,
|
||||
need_wisdom,
|
||||
add_strength,
|
||||
add_dexterity,
|
||||
add_intuition,
|
||||
add_endurance,
|
||||
add_intelligence,
|
||||
add_wisdom,
|
||||
add_accuracy,
|
||||
add_evasion,
|
||||
add_criticals,
|
||||
add_min_physical_damage,
|
||||
add_max_physical_damage,
|
||||
image,
|
||||
weight,
|
||||
greatest(
|
||||
(
|
||||
(add_strength + add_dexterity + add_intuition + add_endurance + add_intelligence + add_wisdom) *
|
||||
(5 + floor((add_strength + add_dexterity + add_intuition + add_endurance + add_intelligence + add_wisdom) / 10))
|
||||
) +
|
||||
(
|
||||
(add_accuracy + add_criticals + add_evasion) *
|
||||
(2 + floor((add_accuracy + add_criticals + add_evasion) / 50))
|
||||
) +
|
||||
(
|
||||
(add_min_physical_damage + add_max_physical_damage) *
|
||||
(1 + floor((add_min_physical_damage + add_max_physical_damage) / 100))
|
||||
)
|
||||
,1)
|
||||
from items where id = ?';
|
||||
private const BUY_QUERY = <<<SQL
|
||||
insert into inventory (
|
||||
owner_id, name, item_type, durability,
|
||||
need_strength, need_dexterity, need_intuition, need_endurance, need_intelligence, need_wisdom,
|
||||
add_strength, add_dexterity, add_intuition, add_endurance, add_intelligence, add_wisdom,
|
||||
add_accuracy, add_evasion, add_criticals, add_min_physical_damage, add_max_physical_damage,
|
||||
image, weight, price)
|
||||
select
|
||||
?, name, item_type, durability,
|
||||
need_strength, need_dexterity, need_intuition, need_endurance, need_intelligence, need_wisdom,
|
||||
add_strength, add_dexterity, add_intuition, add_endurance, add_intelligence, add_wisdom,
|
||||
add_accuracy, add_evasion, add_criticals, add_min_physical_damage, add_max_physical_damage,
|
||||
image, weight, greatest(
|
||||
(
|
||||
(add_strength + add_dexterity + add_intuition + add_endurance + add_intelligence + add_wisdom) *
|
||||
(5 + floor((add_strength + add_dexterity + add_intuition + add_endurance + add_intelligence + add_wisdom) / 10))
|
||||
) +
|
||||
(
|
||||
(add_accuracy + add_criticals + add_evasion) *
|
||||
(2 + floor((add_accuracy + add_criticals + add_evasion) / 50))
|
||||
) +
|
||||
(
|
||||
(add_min_physical_damage + add_max_physical_damage) *
|
||||
(1 + floor((add_min_physical_damage + add_max_physical_damage) / 100))
|
||||
)
|
||||
,1)
|
||||
from items where id = ?
|
||||
SQL;
|
||||
|
||||
// Тип операции в магазине. Для отображения разных блоков в разных случаях.
|
||||
private $optype;
|
||||
private ?int $shop_item_quantity;
|
||||
|
||||
Reference in New Issue
Block a user