Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $data=" ";
- $student = Student::find(1)->student;
- $scores = Score::where('school_id',$request->id)
- ->selectRaw('sum(score) as test, where des = Test1')
- ->groupBy('student_id','des')
- ->get();
- if($scores)
- {
- $i=1;
- foreach ($scores as $score)
- {
- $data .= '<tr><td>'.$i++.'</td>
- <td>'.$score->student['name'].'</td>
- <td>'.$score->test.'</td>
- </tr>';
- }
- return Response($data);
- }
Add Comment
Please, Sign In to add comment