This commit is contained in:
lopar
2020-07-06 23:34:34 +03:00
parent 2093235f0e
commit 321a332612
2 changed files with 19 additions and 19 deletions
+14 -9
View File
@@ -10,18 +10,23 @@ class DressedItems
protected $DB;
private $dressedItem;
public function __construct(int $user_id)
{
try {
$this->DB = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $user_id);
} catch (Exception $e) {
echo '<div class="debug">' . $e . '</div>';
}
public function __construct() {
// Пустой потому что нужны разные запросы.
}
public function getDressedItems()
private function getDressedItems($user_id)
{
while ($row = $this->DB->fetch_assoc()) {
try {
return db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $user_id);
} catch (Exception $e) {
echo '<div class="debug">getDressedItems: ' . $e . '</div>';
}
return null;
}
public function getSlots($user_id)
{
while ($row = $this->getDressedItems($user_id)->fetch_assoc()) {
$dressed_item[$row['dressed_slot']] = $row;
$this->dressedItem[$row['dressed_slot']] = $row;
}