tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user