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