38 lines
986 B
PHP
38 lines
986 B
PHP
<?php
|
||
/**
|
||
* Author: lopiu
|
||
* Date: 05.07.2020
|
||
* Time: 23:32
|
||
*/
|
||
|
||
class EffectsModel
|
||
{
|
||
protected $DB;
|
||
const EFFECT_HIDEUSERINFO = 5; // Обезлик
|
||
public function __construct(int $user_id) {
|
||
try {
|
||
$this->DB = db::c()->query('SELECT * FROM users_effects WHERE owner_id = ?i', $user_id);
|
||
} catch (Exception $e) {echo '<div class="debug">class EffectsModel: Не могу подключиться к таблице effects!</div>';}
|
||
}
|
||
|
||
private function getEffects($user_id)
|
||
{
|
||
|
||
}
|
||
|
||
/**
|
||
* Проверка обезличен ли персонаж.
|
||
* @return int date() до конца эффекта или 0.
|
||
*/
|
||
public function getHideUserInfoStatus()
|
||
{
|
||
if ($this->DB) {
|
||
while ($row = $this->DB->fetch_object()) {
|
||
if ($row->type == self::EFFECT_HIDEUSERINFO) {
|
||
return $row->time;
|
||
}
|
||
}
|
||
}
|
||
return 0;
|
||
}
|
||
} |