Guest User

Untitled

a guest
Jun 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. $data=" ";
  2. $student = Student::find(1)->student;
  3. $scores = Score::where('school_id',$request->id)
  4. ->selectRaw('sum(score) as test, where des = Test1')
  5. ->groupBy('student_id','des')
  6. ->get();
  7. if($scores)
  8. {
  9. $i=1;
  10. foreach ($scores as $score)
  11. {
  12. $data .= '<tr><td>'.$i++.'</td>
  13. <td>'.$score->student['name'].'</td>
  14. <td>'.$score->test.'</td>
  15. </tr>';
  16. }
  17. return Response($data);
  18. }
Add Comment
Please, Sign In to add comment