fix: changed query for employee overview

This commit is contained in:
Ioannis20x
2025-07-07 14:31:57 +02:00
parent 1ffd531aa3
commit 080c76ebe0
2 changed files with 7 additions and 3 deletions

0
lager.php Normal file
View File

View File

@@ -8,11 +8,15 @@ if ($dbhandle->connect_error) {
} }
// Query // Query
$sql = "SELECT clientname, SUM(preis) AS gesamt_einnahmen, ROUND(SUM(preis) * 0.1, 2) AS abschlag $sql = "SELECT CONCAT(u.discord_name) AS clientname,
FROM contracts SUM(c.preis) AS gesamt_einnahmen,
GROUP BY clientname ROUND(SUM(c.preis) * 0.1, 2) AS abschlag
FROM contracts c
INNER JOIN users u ON c.user_id = u.id
GROUP BY u.id, u.discord_name
ORDER BY gesamt_einnahmen DESC"; ORDER BY gesamt_einnahmen DESC";
$result = $dbhandle->query($sql); $result = $dbhandle->query($sql);
?> ?>
<!DOCTYPE html> <!DOCTYPE html>