stageId = $stageId; } public function loadMatchData() { $datas = PairModel::where([ array('stage_id', $this->stageId), array('state', '>', 100) ])->whereNull('assoc_id')->get()->sortByDesc('score')->toArray(); $this->dataSources = array_map(function ($data) { return new PairMatchDataSource($data); }, $datas); } }