Optimize query with eager loading

This commit is contained in:
Kevin
2018-09-04 20:02:16 +08:00
parent c95fe3c971
commit f7ae027156
7 changed files with 8 additions and 4 deletions

View File

@@ -199,6 +199,7 @@ class PirepController extends Controller
$this->pirepRepo->pushCriteria($criterea);
$pireps = $this->pirepRepo
->with(['airline', 'aircraft', 'dpt_airport', 'arr_airport'])
->whereNotInOrder('state', [
PirepState::CANCELLED,
PirepState::DRAFT,