up décompte lieux
This commit is contained in:
parent
4fbdcfc704
commit
4300278f15
2 changed files with 27 additions and 8 deletions
|
@ -385,20 +385,22 @@ final class AdminController extends AbstractController
|
|||
|
||||
// Récupérer les derniers followups pour chaque type
|
||||
$latestFollowups = [];
|
||||
$types = [
|
||||
'fire_hydrant', 'charging_station', 'toilets', 'bus_stop', 'defibrillator', 'camera', 'recycling', 'substation', 'places'
|
||||
];
|
||||
$types = array_keys(\App\Service\FollowUpService::getFollowUpThemes());
|
||||
foreach ($types as $type) {
|
||||
$count = null;
|
||||
$completion = null;
|
||||
foreach ($stats->getCityFollowUps() as $fu) {
|
||||
if ($fu->getName() === $type . '_count') {
|
||||
if ($count === null || $fu->getDate() > $count->getDate()) {
|
||||
if ($count === null) {
|
||||
$count = $fu;
|
||||
} else if ($fu->getDate() > $count->getDate()) {
|
||||
$count = $fu;
|
||||
}
|
||||
}
|
||||
if ($fu->getName() === $type . '_completion') {
|
||||
if ($completion === null || $fu->getDate() > $completion->getDate()) {
|
||||
if ($completion === null) {
|
||||
$completion = $fu;
|
||||
} else if ($fu->getDate() > $completion->getDate()) {
|
||||
$completion = $fu;
|
||||
}
|
||||
}
|
||||
|
@ -412,12 +414,16 @@ final class AdminController extends AbstractController
|
|||
$completion = null;
|
||||
foreach ($stats->getCityFollowUps() as $fu) {
|
||||
if ($fu->getName() === 'places_count') {
|
||||
if ($count === null || $fu->getDate() > $count->getDate()) {
|
||||
if ($count === null) {
|
||||
$count = $fu;
|
||||
} else if ($fu->getDate() > $count->getDate()) {
|
||||
$count = $fu;
|
||||
}
|
||||
}
|
||||
if ($fu->getName() === 'places_completion') {
|
||||
if ($completion === null || $fu->getDate() > $completion->getDate()) {
|
||||
if ($completion === null) {
|
||||
$completion = $fu;
|
||||
} else if ($fu->getDate() > $completion->getDate()) {
|
||||
$completion = $fu;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue