mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-09 17:02:46 +02:00
up décompte de suivi des lieux et arbres
This commit is contained in:
parent
6c457986ad
commit
949dc71fb8
4 changed files with 65 additions and 23 deletions
|
@ -86,13 +86,22 @@ class FollowUpController extends AbstractController
|
|||
$followups = $followups->toArray();
|
||||
usort($followups, fn($a, $b) => $a->getDate() <=> $b->getDate());
|
||||
$series = [];
|
||||
$all_points = [];
|
||||
foreach ($followups as $fu) {
|
||||
$series[$fu->getName()][] = [
|
||||
'date' => $fu->getDate()->format('c'),
|
||||
'value' => $fu->getMeasure(),
|
||||
'name' => $fu->getName(),
|
||||
];
|
||||
$all_points[] = [
|
||||
'date' => $fu->getDate()->format('c'),
|
||||
'type' => $fu->getName(),
|
||||
'name' => $fu->getName(),
|
||||
'value' => $fu->getMeasure(),
|
||||
];
|
||||
}
|
||||
usort($all_points, fn($a, $b) => strcmp($b['date'], $a['date']));
|
||||
$all_points = array_slice($all_points, 0, 20);
|
||||
// Tri par date dans chaque série
|
||||
foreach ($series as &$points) {
|
||||
usort($points, function($a, $b) {
|
||||
|
@ -103,6 +112,7 @@ class FollowUpController extends AbstractController
|
|||
return $this->render('admin/followup_graph.html.twig', [
|
||||
'stats' => $stats,
|
||||
'series' => $series,
|
||||
'all_points' => $all_points,
|
||||
'followup_labels' => FollowUpService::getFollowUpThemes(),
|
||||
'followup_icons' => FollowUpService::getFollowUpIcons(),
|
||||
'followup_overpass' => FollowUpService::getFollowUpOverpassQueries(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue