LOADING

Laravel关联表中表

$log = Invite::where('from_teacher_id',session('teacher')['id'])

        ->with('hasTeacher')
        ->with('hasBanjis')
        ->with('hasBanjis.hasBanjiStudents')
        ->with('hasBanjis.hasTasks.hasStudentHomeworks')
        ->get();

如果是hasmany就用循环,如果是hasOne就直接->用

标签: none

添加新评论