Skip to content

Commit

Permalink
Important: Fixed issue with IDs, User id was being overwritten by Dep…
Browse files Browse the repository at this point in the history
…artment id. When creating a course, the teacher id was actually the department id
  • Loading branch information
gerpollo2000 committed Jul 28, 2019
1 parent 011cc8c commit 4994c62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Controllers/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public function index() {
$classes = Myclass::all();
$sections = Section::all();
$departments = Department::bySchool(\Auth::user()->school_id)->get();
$teachers = User::join('departments', 'departments.id', '=', 'users.department_id')
$teachers = User::select('departments.*', 'users.*')
->join('departments', 'departments.id', '=', 'users.department_id')
->where('role', 'teacher')
->orderBy('name', 'ASC')
->where('active', 1)
Expand Down

0 comments on commit 4994c62

Please sign in to comment.