Change checkin ID filtering

This commit is contained in:
Ben Goldsworthy 2022-12-12 18:25:11 -06:00
parent 6392989456
commit b586687174

View file

@ -47,20 +47,18 @@ class TrackerController extends Controller
if ($fromCheckin) { if ($fromCheckin) {
$tripData->checkins = array_filter( $tripData->checkins = array_filter(
$tripData->checkins, $tripData->checkins,
function ($key) use ($fromCheckin) { function ($checkin) use ($fromCheckin) {
return $key >= $fromCheckin; return $checkin->id >= $fromCheckin;
}, }
ARRAY_FILTER_USE_KEY
); );
} }
if ($toCheckin) { if ($toCheckin) {
$tripData->checkins = array_filter( $tripData->checkins = array_filter(
$tripData->checkins, $tripData->checkins,
function ($key) use ($toCheckin) { function ($checkin) use ($toCheckin) {
return $key <= $toCheckin; return $checkin->id <= $toCheckin;
}, }
ARRAY_FILTER_USE_KEY
); );
} }