From adcf13402e0fb48435135031b3b3f2d475ca8efa Mon Sep 17 00:00:00 2001 From: haidar <89732397+haidarhamda@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:34:15 +0700 Subject: [PATCH] fix: sighting join --- src/services/SightingSrv.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/services/SightingSrv.php b/src/services/SightingSrv.php index e02d2c6..b9830ed 100644 --- a/src/services/SightingSrv.php +++ b/src/services/SightingSrv.php @@ -51,11 +51,15 @@ class SightingSrv extends BaseSrv // } // } $sightings = []; - foreach ($res as $re) { - foreach ($re as $r) { - $sighting = new SightingModel(); - $sightings[] = $sighting->constructFromArray($r); - } +// echo $res; + foreach ($res['result'] as $re) { + $sighting = new SightingModel(); + $sightings[] = $sighting->constructFromArray($re); +// echo $re; +// echo "<br>"; +// foreach ($re as $r) { +// +// } } return ["result" => $sightings, "count" => $res["count"]]; } -- GitLab