Зимние правки. MVC/

Signed-off-by: lopar <lopar.4ever@gmail.com>
This commit is contained in:
lopar
2022-08-09 22:57:43 +03:00
parent 0f62ee20e7
commit b9b4c01cf0
104 changed files with 2254 additions and 2086 deletions
+8 -2
View File
@@ -14,6 +14,7 @@ class Check
* Check constructor.
*
* @param User $user
* @param Db $db
*/
public function __construct(User $user, Db $db)
{
@@ -21,8 +22,13 @@ class Check
$this->db = $db;
}
public function Effects()
public static function expiredEffects()
{
return $this->db->execute('delete from users_effects where remaining_time <= ?', strtotime('now'));
return Db::getInstance()->execute('delete from users_effects where remaining_time <= ?', strtotime('now'));
}
public static function userExists($id): bool
{
return Db::getInstance()->fetchColumn('select count(*) from users where id = ?', $id) > 0;
}
}