game/_incl_data/class/Insallah/Tournament/TournamentUserCheckModel.php

60 lines
1.3 KiB
PHP
Raw Normal View History

2022-12-19 20:22:19 +00:00
<?php
namespace Insallah;
class TournamentUserCheckModel
{
private $id;
private $level;
/**
* @param $id
*/
public function __construct($id)
{
$this->id = $id;
$this->level = Db::getValue('select level from users where id = ? and level between 8 and 12 and battle = 0', [$id]);
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 30 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*
* @return int
*/
public function getLevel()
{
return $this->level;
}
/**
* @param int $price
* @return bool
*/
public function isEkrOverpriced($price)
{
$wearedItemsEkrPrice = Db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$this->id]);
return $wearedItemsEkrPrice > $price;
}
/**
* @param int $minExp
* @return bool
*/
public function isEnoughExperience($minExp)
{
return Db::getValue('select exp from stats where id = ?', [$this->id]) >= $minExp;
}
/**
* @return bool
*/
public function IsRestrictedToJoin()
{
$delayEffect = Db::getValue(
'select count(*) from eff_users where uid = ? and id_eff = 486 and `delete` = 0', [$this->id]
);
return (bool)$delayEffect;
}
}