class errors
This commit is contained in:
parent
b6640ae32f
commit
d3a0465f9a
@ -7,9 +7,9 @@
|
||||
|
||||
class DressedItems
|
||||
{
|
||||
protected $DB;
|
||||
protected static $DB;
|
||||
protected $DBSUM;
|
||||
protected $USERID;
|
||||
protected static $USERID;
|
||||
private $dressedItem;
|
||||
|
||||
/**
|
||||
@ -19,13 +19,14 @@ class DressedItems
|
||||
*/
|
||||
public function __construct($user_id)
|
||||
{
|
||||
$this->USERID = $user_id;
|
||||
//$this->USERID = $user_id;
|
||||
self::$USERID = $user_id;
|
||||
}
|
||||
|
||||
private function getDressedItems()
|
||||
private static function getDressedItems()
|
||||
{
|
||||
try {
|
||||
$this->DB = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', $this->USERID);
|
||||
self::$DB = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i AND dressed_slot > 0', self::$USERID);
|
||||
} catch (Exception $e) {
|
||||
echo '<div class="debug">Не прогрузилась таблица inventory (*) для класса DressedItems.</div>';
|
||||
}
|
||||
@ -48,7 +49,7 @@ SELECT SUM(add_strength) as sum_strength,
|
||||
SUM(add_max_physical_damage) as sum_max_phys_damage
|
||||
FROM inventory WHERE owner_id = ?i AND dressed_slot > 0
|
||||
SQL;
|
||||
$this->DBSUM = db::c()->query($query, $this->USERID)->fetch_assoc();
|
||||
$this->DBSUM = db::c()->query($query, self::$USERID)->fetch_assoc();
|
||||
} catch (Exception $e) {
|
||||
echo '<div class="debug">Не прогрузилась таблица inventory (SUM) для класса DressedItems:' . $e . '</div>';
|
||||
}
|
||||
@ -56,11 +57,11 @@ SQL;
|
||||
|
||||
public function getItemsInSlots()
|
||||
{
|
||||
if (!$this->DB) {
|
||||
if (!self::$DB) {
|
||||
//$this->getDressedItems();
|
||||
self::getDressedItems();
|
||||
}
|
||||
while ($row = $this->DB->fetch_assoc()) {
|
||||
while ($row = self::$DB->fetch_assoc()) {
|
||||
$dressed_item[$row['dressed_slot']] = $row;
|
||||
$this->dressedItem[$row['dressed_slot']] = $row;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user