$homework = DB::select('select * from homework
left join class on class.class_id=homework.class_id
left join chapter on chapter.chapter_id=homework.chapter_id
left join section on section.section_id=homework.section_id
left join student on student.student_id=homework.student_id
order by homework.class_id,chapter_num,section_num');
$homework = DB::table('homework')
->leftJoin('class', 'class.class_id', '=', 'homework.class_id')
->leftJoin('chapter', 'chapter.chapter_id', '=', 'homework.chapter_id')
->leftJoin('section', 'section.section_id', '=', 'homework.section_id')
->leftJoin('student', 'student.student_id', '=', 'homework.student_id')
->orderBy('homework.class_id','chapter_num','section_num')
->where('class.admin_id','=',$admin_id)
->paginate(8);
sql语句
最新推荐文章于 2022-08-17 22:30:27 发布