Last active
January 10, 2019 04:33
-
-
Save ahmadshobirin/27b9acbc0df8af8e664ccdfb66e1e24c to your computer and use it in GitHub Desktop.
This file contains 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
public function classes($teacherId) | |
{ | |
$teacherClass = | |
TeacherClass::join('m_class','m_class.id','m_teacher_class.class_id') | |
->select('m_teacher_class.class_id','m_class.name as name_class', | |
DB::raw("(select COUNT(*) from m_student where m_student.class_id = m_teacher_class.class_id ) as student") | |
) | |
->where('teacher_id',$teacherId)->get(); | |
dd($teacherClass); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment