fix(wish): #107 price not setting
This commit is contained in:
parent
8257fcd2e8
commit
37fbf05862
1 changed files with 6 additions and 3 deletions
|
@ -50,9 +50,10 @@ class Wish
|
||||||
global $database;
|
global $database;
|
||||||
|
|
||||||
$wishQuery = $database->query(
|
$wishQuery = $database->query(
|
||||||
'SELECT *
|
' SELECT `wishes`.*, `products`.`price`
|
||||||
FROM `wishes`
|
FROM `wishes`
|
||||||
WHERE `wishes`.`id` = :wish_id',
|
LEFT JOIN `products` ON `wishes`.`id` = `products`.`wish`
|
||||||
|
WHERE `wishes`.`id` = :wish_id',
|
||||||
array(
|
array(
|
||||||
'wish_id' => $wishId,
|
'wish_id' => $wishId,
|
||||||
)
|
)
|
||||||
|
@ -186,6 +187,7 @@ class Wish
|
||||||
$this->status = $wishData['status'];
|
$this->status = $wishData['status'];
|
||||||
$this->is_purchasable = $wishData['is_purchasable'];
|
$this->is_purchasable = $wishData['is_purchasable'];
|
||||||
$this->edited = $wishData['edited'] ? \strtotime($wishData['edited']) : null;
|
$this->edited = $wishData['edited'] ? \strtotime($wishData['edited']) : null;
|
||||||
|
$this->price = $wishData['price'] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCard(int $ofUser): string
|
public function getCard(int $ofUser): string
|
||||||
|
@ -422,6 +424,7 @@ class Wish
|
||||||
'status' => $this->status,
|
'status' => $this->status,
|
||||||
'is_purchasable' => $this->is_purchasable,
|
'is_purchasable' => $this->is_purchasable,
|
||||||
'edited' => $this->edited,
|
'edited' => $this->edited,
|
||||||
|
'price' => $this->price,
|
||||||
);
|
);
|
||||||
|
|
||||||
return $wishArray;
|
return $wishArray;
|
||||||
|
|
Loading…
Reference in a new issue