$data = Model_Course::query()
->where('course_id', 'in', array(5,6,7))
->get();
$data2 = Model_Course::query()
->related('students')
->where('course_id', 5)
->where('students.grade', 'A')
->get();
$data3 = Model_Course::query()
->related('students')
->where('course_id', 5)
->where('students.name', 'Mike')
->get();
It looks like you're new here. If you want to get involved, click one of these buttons!