Change checkin ID filtering
This commit is contained in:
parent
6392989456
commit
b586687174
1 changed files with 6 additions and 8 deletions
|
@ -47,20 +47,18 @@ class TrackerController extends Controller
|
|||
if ($fromCheckin) {
|
||||
$tripData->checkins = array_filter(
|
||||
$tripData->checkins,
|
||||
function ($key) use ($fromCheckin) {
|
||||
return $key >= $fromCheckin;
|
||||
},
|
||||
ARRAY_FILTER_USE_KEY
|
||||
function ($checkin) use ($fromCheckin) {
|
||||
return $checkin->id >= $fromCheckin;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if ($toCheckin) {
|
||||
$tripData->checkins = array_filter(
|
||||
$tripData->checkins,
|
||||
function ($key) use ($toCheckin) {
|
||||
return $key <= $toCheckin;
|
||||
},
|
||||
ARRAY_FILTER_USE_KEY
|
||||
function ($checkin) use ($toCheckin) {
|
||||
return $checkin->id <= $toCheckin;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue