2020-07-05 21:16:22 +00:00
|
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Author: lopiu
|
|
|
|
|
* Date: 05.07.2020
|
|
|
|
|
* Time: 23:32
|
|
|
|
|
*/
|
2020-10-28 20:21:08 +00:00
|
|
|
|
namespace Battles\Models;
|
2020-07-05 21:16:22 +00:00
|
|
|
|
class EffectsModel
|
|
|
|
|
{
|
|
|
|
|
protected $DB;
|
2020-07-06 18:41:32 +00:00
|
|
|
|
const EFFECT_HIDEUSERINFO = 5; // Обезлик
|
2020-07-05 21:16:22 +00:00
|
|
|
|
public function __construct(int $user_id) {
|
2020-07-05 21:30:21 +00:00
|
|
|
|
try {
|
2020-10-28 20:21:08 +00:00
|
|
|
|
$this->DB = \db::c()->query('SELECT * FROM users_effects WHERE owner_id = ?i', $user_id);
|
|
|
|
|
} catch (\Throwable $e) {echo '<div class="debug">class EffectsModel: Не могу подключиться к таблице effects!</div>';}
|
2020-07-05 21:16:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-07 13:15:58 +00:00
|
|
|
|
private function getEffects($user_id)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|