mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-04 17:04:53 +02:00
budget formaté en M€ sur le dashboard
This commit is contained in:
parent
acb71e45e0
commit
1ad909cb86
2 changed files with 18 additions and 1 deletions
|
@ -230,6 +230,23 @@ class FraicheurController extends AbstractController
|
|||
ksort($villesByBinBudget);
|
||||
ksort($villesByBinEcart);
|
||||
|
||||
// Remplir les bins vides pour l'histogramme budget par lieu (pas de 5000€)
|
||||
if (!empty($histogramBudgetParLieu)) {
|
||||
$minBin = min(array_map('intval', array_keys($histogramBudgetParLieu)));
|
||||
$maxBin = max(array_map('intval', array_keys($histogramBudgetParLieu)));
|
||||
for ($bin = $minBin; $bin <= $maxBin; $bin += 5000) {
|
||||
$binStr = (string)$bin;
|
||||
if (!isset($histogramBudgetParLieu[$binStr])) {
|
||||
$histogramBudgetParLieu[$binStr] = 0;
|
||||
}
|
||||
if (!isset($villesByBinBudgetParLieu[$binStr])) {
|
||||
$villesByBinBudgetParLieu[$binStr] = [];
|
||||
}
|
||||
}
|
||||
ksort($histogramBudgetParLieu);
|
||||
ksort($villesByBinBudgetParLieu);
|
||||
}
|
||||
|
||||
ksort($histogramBudgetParLieu);
|
||||
ksort($villesByBinBudgetParLieu);
|
||||
$budgetData = [
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
<td>{{ stat.completionPercent }}%</td>
|
||||
<td>{{ stat.placesCount }}</td>
|
||||
<td>{{ (stat.placesCount / (stat.population or 1 ))|round(2) }}</td>
|
||||
<td>{% if stat.budgetAnnuel %}{{ stat.budgetAnnuel|number_format(0, '.', ' ') }} €{% else %}-{% endif %}</td>
|
||||
<td>{% if stat.budgetAnnuel %}{{ (stat.budgetAnnuel / 1000000)|number_format(1, '.', ' ') }} M€{% else %}-{% endif %}</td>
|
||||
<td>{% if stat.budgetAnnuel and stat.population %}{{ (stat.budgetAnnuel / stat.population)|number_format(0, '.', ' ') }} €{% else %}-{% endif %}</td>
|
||||
<td>{% if stat.budgetAnnuel and stat.placesCount %}{{ (stat.budgetAnnuel / stat.placesCount)|number_format(0, '.', ' ') }} €{% else %}-{% endif %}</td>
|
||||
<td>{{ stat.osmDataDateAvg|date('Y-m-d H:i') }}</td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue