Skip to content

Commit

Permalink
fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
tomahock committed Jul 9, 2024
1 parent 0a1243f commit ece9d3e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/Jobs/ProcessICNFNewFireData.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public function handle()

preg_match_all('/\[(.*?)\]/', $data, $result);

print_r($result);

$i = 0;
foreach ($result[1] as $r) {
if ($i === 0 || $i === 1) {
Expand All @@ -65,10 +63,10 @@ public function handle()

$id = strip_tags(str_replace("'", '', $rr[0]));

$this->incident = Incident::where('id', $id)
$incident = Incident::where('id', $id)
->get();

if (!isset($this->incident[0])) {
if (!isset($incident[0])) {
$d = $this->getData($id);

$date = new Carbon($d->DATAALERTA->__toString() . ' ' . $d->HORAALERTA->__toString(), 'Europe/lisbon');
Expand Down Expand Up @@ -125,7 +123,13 @@ public function handle()

Log::debug(json_encode($point));

$incident = new Incident($point);
$incidentDb = new Incident($point);
$incidentDb->save();
} else {
$incident = $incident[0];
$incident->statusCode = $statusCode;
$incident->status = $status;
$incident->statusColor = $statusColor;
$incident->save();
}
}
Expand Down

0 comments on commit ece9d3e

Please sign in to comment.