Guest User

Untitled

a guest
Dec 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public function handle()
  2. {
  3. $matches = AppMatch::where('status', 'open')->get();
  4. foreach($matches as $match) {
  5. if($match->teamA->name == 'TBD' || $match->teamB->name == 'TBD') {
  6. continue;
  7. }
  8. if(CarbonCarbon::now()->diffInSeconds($match->schedule, false) <= 0 && !$match->re_opened) {
  9. $this->info('[' . CarbonCarbon::now()->addSeconds(10)->diffForHumans() . '] Found match [Match ID: ' . $match->id . '] ' . $match->name . ' - closing...');
  10. setupOngoingMatch($match);
  11. }
  12. }
  13. }
  14.  
  15. if(CarbonCarbon::now()->addSeconds(60)->diffForHumans()->diffInSeconds($match->schedule, false) <= 0 && !$match->re_opened)
Add Comment
Please, Sign In to add comment