Замена mysql_query и упрощение.
This commit is contained in:
@@ -169,8 +169,17 @@ insert into eff_users
|
||||
return Db::getValue('select count(*) from eff_users where (id_eff between 301 and 304 or id_eff between 321 and 332) and id = ? and uid = ?', [$addictionId, $uid]) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $userId если 0, удаление только по id.
|
||||
* @param int $id
|
||||
* @return void
|
||||
*/
|
||||
public static function removeById(int $userId, int $id): void
|
||||
{
|
||||
if ($userId === 0) {
|
||||
Db::sql('delete from eff_users where id = ?', [$id]);
|
||||
return;
|
||||
}
|
||||
Db::sql('delete from eff_users where id = ? and uid = ?', [$id, $userId]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user