mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-07-09 15:27:32 +00:00
history.php: Simplify addition
This commit is contained in:
parent
05d10a211c
commit
4b3565b9aa
10
history.php
10
history.php
@ -113,15 +113,15 @@ try {
|
|||||||
$total = 0;
|
$total = 0;
|
||||||
|
|
||||||
$count_st = $page->conn->prepare("SELECT
|
$count_st = $page->conn->prepare("SELECT
|
||||||
(SELECT COUNT(*) FROM $t_bans WHERE $field=:uuid0) as c_bans,
|
(SELECT COUNT(*) FROM $t_bans WHERE $field=:uuid0) +
|
||||||
(SELECT COUNT(*) FROM $t_mutes WHERE $field=:uuid1) as c_mutes,
|
(SELECT COUNT(*) FROM $t_mutes WHERE $field=:uuid1) +
|
||||||
(SELECT COUNT(*) FROM $t_warnings WHERE $field=:uuid2) as c_warnings,
|
(SELECT COUNT(*) FROM $t_warnings WHERE $field=:uuid2) +
|
||||||
(SELECT COUNT(*) FROM $t_kicks WHERE $field=:uuid3) as c_kicks
|
(SELECT COUNT(*) FROM $t_kicks WHERE $field=:uuid3) as total
|
||||||
");
|
");
|
||||||
for ($i = 0; $i <= 3; $i++) $count_st->bindParam(":uuid$i", $uuid, PDO::PARAM_STR);
|
for ($i = 0; $i <= 3; $i++) $count_st->bindParam(":uuid$i", $uuid, PDO::PARAM_STR);
|
||||||
|
|
||||||
if ($count_st->execute() && ($row = $count_st->fetch()) !== null) {
|
if ($count_st->execute() && ($row = $count_st->fetch()) !== null) {
|
||||||
$total = $row['c_bans'] + $row['c_mutes'] + $row['c_warnings'] + $row['c_kicks'];
|
$total = $row['total'];
|
||||||
}
|
}
|
||||||
$count_st->closeCursor();
|
$count_st->closeCursor();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user