Browse Source

only set distance if available

master
Aaron Parecki 5 months ago
parent
commit
da66d29966
No known key found for this signature in database GPG Key ID: 276C2817346D6056
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      compass/app/Jobs/TripComplete.php

+ 4
- 1
compass/app/Jobs/TripComplete.php View File

@@ -44,11 +44,14 @@ class TripComplete extends Job implements SelfHandling, ShouldQueue
'mode' => $this->_data['properties']['mode'],
'start_location' => $this->_data['properties']['start_location'],
'end_location' => $this->_data['properties']['end_location'],
'distance' => $this->_data['properties']['distance'],
'start' => $this->_data['properties']['start'],
'end' => $this->_data['properties']['end']
]
];

if(isset($this->_data['properties']['distance']))
$trip['trip']['distance'] = $this->_data['properties']['distance'];

$trip = json_encode($trip, JSON_UNESCAPED_SLASHES);

foreach($urls as $url) {


Loading…
Cancel
Save