Add greater than/less than search options #297

This commit is contained in:
Nabeel Shahzad
2019-05-10 16:03:04 -05:00
parent 1dae81b707
commit 5b061ba636
7 changed files with 69 additions and 10 deletions

View File

@@ -103,6 +103,16 @@ class FlightRepository extends Repository implements CacheableInterface
$where['arr_airport_id'] = $request->arr_icao;
}
// Distance, greater than
if ($request->filled('dgt')) {
$where[] = ['distance', '>=', $request->dgt];
}
// Distance, less than
if ($request->filled('dlt')) {
$where[] = ['distance', '<', $request->dlt];
}
$this->pushCriteria(new WhereCriteria($request, $where));
return $this;