up labourage nouvelle ville

This commit is contained in:
Tykayn 2025-07-15 21:46:30 +02:00 committed by tykayn
parent cc6c991090
commit c0a1780fce
4 changed files with 44 additions and 31 deletions

View file

@ -458,11 +458,13 @@ class PublicController extends AbstractController
$stats = $place->getStats();
if (!$stats) {
$stats = $this->entityManager->getRepository(Stats::class)->findOneBy(['zone' => $place->getZipCode()]);
}
if (!$stats) {
$stats = new Stats();
$stats->setZone($place->getZipCode());
$stats_exist = $this->entityManager->getRepository(Stats::class)->findOneBy(['zone' => $place->getZipCode()]);
if ($stats_exist) {
$stats = $stats_exist;
} else {
$stats = new Stats();
$stats->setZone($place->getZipCode());
}
}
$stats->addPlace($place);