From 73e021c85411998c2e6dbbcb38ddd5e11f049827 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 29 Jun 2025 11:00:13 +0200 Subject: [PATCH] =?UTF-8?q?fix=20d=C3=A9compte=20de=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/AdminController.php | 4 ---- src/Entity/Place.php | 1 + src/Entity/Stats.php | 7 +++++++ src/Service/Motocultrice.php | 5 +++-- templates/admin/stats/row.html.twig | 1 - 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 144ff6f..81415eb 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -94,8 +94,6 @@ final class AdminController extends AbstractController ->setSiret($this->motocultrice->find_siret($placeData['tags']) ?? '') ->setAskedHumainsSupport(false) ->setLastContactAttemptDate(null) - ->setNote($this->motocultrice->find_tag($placeData['tags'], 'note') ? true : false) - ->setNoteContent($this->motocultrice->find_tag($placeData['tags'], 'note') ?? '') ->setPlaceCount(0) // ->setOsmData($placeData['modified'] ?? null) ; @@ -575,8 +573,6 @@ final class AdminController extends AbstractController ->setSiret($this->motocultrice->find_siret($placeData['tags']) ?? '') ->setAskedHumainsSupport(false) ->setLastContactAttemptDate(null) - ->setNote($this->motocultrice->find_tag($placeData['tags'], 'note') ? true : false) - ->setNoteContent($this->motocultrice->find_tag($placeData['tags'], 'note') ?? '') ->setPlaceCount(0) // ->setOsmData($placeData['modified'] ?? null) ; diff --git a/src/Entity/Place.php b/src/Entity/Place.php index bbf1e54..6838272 100644 --- a/src/Entity/Place.php +++ b/src/Entity/Place.php @@ -314,6 +314,7 @@ class Place } $this->setNoteContent($noteContent ? $noteContent : null); $this->setHasNote($hasNote); + $this->setNote($noteContent); } public function __construct() diff --git a/src/Entity/Stats.php b/src/Entity/Stats.php index d52cede..27d69d7 100644 --- a/src/Entity/Stats.php +++ b/src/Entity/Stats.php @@ -223,10 +223,17 @@ class Stats } if($place->getSiret()) { $this->avec_siret++; + $place_completions++; } if($place->getName()) { $this->avec_name++; + $place_completions++; } + if($place->getNoteContent()) { + $this->avec_note++; + // on ne compte pas les notes comme indice de complétion + } + $somme_completions += $place_completions / 6; } diff --git a/src/Service/Motocultrice.php b/src/Service/Motocultrice.php index b6bcbed..bd40fb3 100644 --- a/src/Service/Motocultrice.php +++ b/src/Service/Motocultrice.php @@ -12,7 +12,7 @@ class Motocultrice public $overpass_base_places = ' ( nw["amenity"~"^(cafe|bar|restaurant|library|cinema|fast_food|post_office|marketplace|community_centre|theatre|bank|townhall|animal_boarding|animal_breeding|animal_shelter|animal_training|archive|arts_centre|bicycle_rental|biergarten|boat_rental|boat_storage|bureau_de_change|canteen|car_rental|car_wash|casino|childcare|clinic|college|conference_centre|courthouse|coworking_space|crematorium|dancing_school|dentist|dive_centre|doctors)$"](area.searchArea); - nw["shop"](area.searchArea); + nw["shop"]["shop"!~"vacant"](area.searchArea); nw["tourism"~"^(hotel|hostel|motel|wilderness_hut|yes|chalet|gallery|guest_house|museum|zoo|theme_park|aquarium|alpine_hut|apartment)$"](area.searchArea); nw["healthcare"](area.searchArea); nw["information"="office"](area.searchArea); @@ -191,7 +191,8 @@ out meta;'; } foreach ($data['elements'] as $element) { - if (isset($element['tags'])) { + if (isset($element['tags'])) { + $places[] = [ 'id' => $element['id'], 'type' => $element['type'], diff --git a/templates/admin/stats/row.html.twig b/templates/admin/stats/row.html.twig index b3c2804..49f7d98 100644 --- a/templates/admin/stats/row.html.twig +++ b/templates/admin/stats/row.html.twig @@ -12,7 +12,6 @@ - voir email