Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. return self::with(['competitions' => function($query) use($date)
  2. {
  3. $query->whereHas('games', function($q) use($date){
  4. $q->whereHas('placard_game', function($q1) use($date){
  5. $q1->where('date', '=', $date)->where('api_sport_code','=','FOOT');
  6. })
  7. ->where('date', '=', $date);
  8. });
  9. }])
  10. ->whereHas('competitions', function($query) use($date) {
  11. $query->whereHas('games', function($q) use($date){
  12. $q->whereHas('placard_game', function($q1) use($date){
  13. $q1->where('date', '=', $date)->where('api_sport_code','=','FOOT');
  14. })
  15. ->where('date', '=', $date);
  16. });
  17. })
  18. ->orderBy('countries.order', 'ASC')
  19. ->orderBy('countries.name', 'ASC')
  20. ->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement