فهرست منبع

Merge branch 'hotfix/V8-6904-correction-pour-que-que-la-zone-'

Olivier Massot 1 سال پیش
والد
کامیت
61ce96b032
2فایلهای تغییر یافته به همراه35 افزوده شده و 1 حذف شده
  1. 7 1
      sql/schema-extensions/001-view_public_events.sql
  2. 28 0
      src/Entity/Public/PublicEvent.php

+ 7 - 1
sql/schema-extensions/001-view_public_events.sql

@@ -26,6 +26,8 @@ CREATE OR REPLACE VIEW view_public_events AS
         r.localisation AS roomLocalisation,
         r.capacity AS roomCapacity,
         r.floorSize AS roomFloorSize,
+        a2.longitude as structureLongitude,
+        a2.latitude as structureLatitude,
         IF(b.image_id is not null, CONCAT('https://api.opentalent.fr/api/public/files/', b.image_id, '/download/lg'), null) AS imageUrl,
         IF(b.image_id is not null, CONCAT('https://api.opentalent.fr/api/public/files/', b.image_id, '/download/md'), null) AS thumbnailUrl,
         (SELECT GROUP_CONCAT(DISTINCT CONCAT(f.code))
@@ -43,11 +45,13 @@ CREATE OR REPLACE VIEW view_public_events AS
         LEFT JOIN Place AS p ON (p.id = b.place_id)
         LEFT JOIN AddressPostal AS ap ON (ap.id = p.addressPostal_id)
         LEFT JOIN Room AS r ON (r.id = b.room_id)
+        LEFT JOIN opentalent.OrganizationAddressPostal oa2 on (oa2.organization_id = o.id and oa2.type='ADDRESS_HEAD_OFFICE')
+        LEFT JOIN opentalent.AddressPostal a2 on (oa2.addressPostal_id = a2.id)
     WHERE b.discr = 'event'
         AND b.datetimeEnd >= NOW()
         AND b.visibility = 'PUBLIC_VISIBILITY'
         AND b.isCanceled = 0
-        AND b.gender_id <> 7 
+        AND b.gender_id <> 7
     UNION
     SELECT
         aw.uuid,
@@ -76,6 +80,8 @@ CREATE OR REPLACE VIEW view_public_events AS
         NULL AS roomLocalisation,
         NULL AS roomCapacity,
         NULL AS roomFloorSize,
+        NULL as structureLongitude,
+        NULL as structureLatitude,
         aw.largeimage AS imageUrl,
         aw.mediumimage as thumbnailUrl,
         aw.categoryCode AS categories,

+ 28 - 0
src/Entity/Public/PublicEvent.php

@@ -100,6 +100,12 @@ class PublicEvent
     #[ORM\Column]
     private ?string $roomFloorSize;
 
+    #[ORM\Column(type: 'float')]
+    private ?float $structureLongitude;
+
+    #[ORM\Column(type: 'float')]
+    private ?float $structureLatitude;
+
     #[ORM\Column]
     private ?string $imageUrl;
 
@@ -337,6 +343,28 @@ class PublicEvent
         return $this;
     }
 
+    public function getStructureLongitude(): ?float
+    {
+        return $this->structureLongitude;
+    }
+
+    public function setStructureLongitude(?float $structureLongitude): self
+    {
+        $this->structureLongitude = $structureLongitude;
+        return $this;
+    }
+
+    public function getStructureLatitude(): ?float
+    {
+        return $this->structureLatitude;
+    }
+
+    public function setStructureLatitude(?float $structureLatitude): self
+    {
+        $this->structureLatitude = $structureLatitude;
+        return $this;
+    }
+
     public function getImageUrl(): ?string
     {
         return $this->imageUrl;