#49: Однажды выставив вещь на продажу её нельзя забрать.
This commit is contained in:
parent
6f7223a242
commit
baf127231e
@ -13,7 +13,6 @@ class ShopItem extends Item
|
||||
private const NO_BARTER_ITEMS = 'У вас нет требуемых предметов!';
|
||||
private const BUTTON = [
|
||||
'setmarket' => 'Сдать в магазин',
|
||||
'unsetmarket' => 'Снять с продажи',
|
||||
'buymarket' => 'Купить с рук',
|
||||
'sellshop' => 'Продать',
|
||||
'buyshop' => 'Купить',
|
||||
@ -252,13 +251,10 @@ SQL;
|
||||
*/
|
||||
public function printControls(): string
|
||||
{
|
||||
if (!in_array($this->optype, ['setmarket', 'unsetmarket', 'buymarket', 'sellshop', 'buyshop',])) {
|
||||
if (!in_array($this->optype, ['setmarket', 'buymarket', 'sellshop', 'buyshop',])) {
|
||||
return '';
|
||||
}
|
||||
$str = $this->optype == 'setmarket' ? '<input placeholder=" ' . $this->price . ' " name="cost">' : '';
|
||||
if ($this->optype === 'buymarket' && $this->ownerId === User::$current->getId()) {
|
||||
$this->optype = 'unsetmarket';
|
||||
}
|
||||
$hiddenValue = $this->optype === 'buyshop' ? $this->offerId : $this->item_id;
|
||||
$button_name = self::BUTTON[$this->optype];
|
||||
return <<<FORM
|
||||
|
Loading…
Reference in New Issue
Block a user