Замена mysql_query и упрощение.

This commit is contained in:
2024-02-10 18:41:23 +02:00
parent 8c49088f27
commit 66d825bc6e
2 changed files with 19 additions and 7 deletions
+9
View File
@@ -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]);
}