示例#1
0
 /**
  * 显示课程学生名单
  * @author FuRongxin
  * @date    2016-03-18
  * @version 2.0
  * @param  \Illuminate\Http\Request  $request 学生名单请求
  * @param   string $kcxh 12位课程序号
  * @return  \Illuminate\Http\Response 学生名录列表
  */
 public function show(Request $request, $kcxh)
 {
     $inputs = $request->all();
     $year = isset($inputs['year']) ? $inputs['year'] : session('year');
     $term = isset($inputs['term']) ? $inputs['term'] : session('term');
     $students = Selcourse::whereKcxh($kcxh)->whereNd($year)->whereXq($term)->orderBy('xh')->get();
     $task = Task::whereKcxh($kcxh)->whereNd($year)->whereXq($term)->whereJsgh(Auth::user()->jsgh)->firstOrFail();
     $title = $task->nd . '年度' . $task->term->mc . '学期' . $task->kcxh . $task->course->kcmc . '课程';
     return view('task.show')->withTitle($title . '学生名单')->withStudents($students);
 }