/** * 显示课程成绩单 * @author FuRongxin * @date 2016-03-13 * @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(); $scores = Dtscore::with('status')->whereKcxh($kcxh)->whereNd($inputs['year'])->whereXq($inputs['term'])->orderBy('xh')->get(); $task = Task::whereKcxh($kcxh)->whereNd($inputs['year'])->whereXq($inputs['term'])->whereJsgh(Auth::user()->jsgh)->firstOrFail(); $ratios = []; $items = Ratio::whereFs($task->cjfs)->orderBy('id')->get(); foreach ($items as $ratio) { $ratios[$ratio->id] = ['id' => $ratio->id, 'name' => $ratio->idm, 'value' => $ratio->bl, 'must_passed' => $ratio->jg]; } $title = $task->nd . '年度' . $task->term->mc . '学期' . $task->kcxh . $task->course->kcmc . '课程'; return view('score.show')->withTitle($title . '成绩单')->withTask($task)->withRatios($ratios)->withScores($scores); }
/** * 显示学生待确认成绩单 * @author FuRongxin * @date 2016-01-27 * @version 2.0 * @return \Illuminate\Http\Response 学生成绩单 */ public function unconfirmed() { // 显示提交状态小于3的成绩 $detail = Dtscore::whereXh(Auth::user()->xh)->where('tjzt', '<', config('constants.score.dconfirmed'))->select('xh', 'xm', 'kcxh', 'kcpt', 'kcxz', 'nd', 'xq', 'kh', 'cj1', 'cj2', 'cj3', 'cj4', 'cj5', 'cj6', 'zpcj', 'kszt', 'tjzt'); // 显示提交状态小于3的补考成绩 $makeup = Muscore::whereXh(Auth::user()->xh)->where('tjzt', '<', config('constants.score.dconfirmed'))->select('xh', 'xm', 'kcxh', 'kcpt', 'kcxz', 'nd', 'xq', 'kh', 'cj1', 'cj2', 'cj3', 'cj4', 'cj5', 'cj6', 'zpcj', 'kszt', 'tjzt'); $scores = $detail->union($makeup)->orderBy('nd', 'desc')->orderBy('xq', 'desc')->get(); $ratios = $this->_arrangeScores($scores); return view('score.show')->withTitle('待确认成绩单')->withRatios($ratios); }