This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select * from ( | |
| select selectone.id, selectone.role, selectone.myb_personnelNo, selectone.myb_fullname from ( | |
| select | |
| detail.id as detail_id, detail.training_event_id, detail.participant_id, detail.mentor_id, | |
| ha.id as pivot_id , ha.assessor_id, | |
| pa.id as id, 'participant' as Role, pa.myb_personnelNo, pa.myb_fullname | |
| from training_details as detail | |
| inner join training_details_has_assessors as ha on detail.id = ha.training_detail_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \DB::enableQueryLog(); | |
| $all = TrainingDetail::event() | |
| ->with(['student' => function($query) use($request) { | |
| $query->where('myb_fullname', 'LIKE', '%'.$request->search.'%'); | |
| $query->groupBy('id'); | |
| }]) | |
| ->with(['teacher' => function($query) use($request) { | |
| $query->where('myb_fullname', 'LIKE', '%'.$request->search.'%'); | |
| $query->groupBy('id'); | |
| }]) |