Пример #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $liendivision = $this->argument('liendivision');
     $id = $this->argument('id');
     $classements = xml_result_equ('classement', $liendivision);
     $i = 1;
     foreach ($classements as $classement) {
         $rank = Rank::where('team_id', $id)->where('equipe', $classement->equipe)->first();
         if ($rank == null) {
             $rank = new Rank();
         }
         $rank->team_id = $id;
         $rank->clt = $classement->clt;
         $rank->clt_h = $i;
         $rank->equipe = $classement->equipe;
         $rank->joue = $classement->joue;
         $rank->pts = $classement->pts;
         $rank->save();
         $i++;
     }
 }
Пример #2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $liendivision = $this->argument('liendivision');
     $id = $this->argument('id');
     $matchs = xml_result_equ('', $liendivision);
     foreach ($matchs as $match) {
         $round = Round::where('team_id', $id)->where('equa', $match->equa)->where('equb', $match->equb)->first();
         if ($round == null) {
             $round = new Round();
         }
         $round->team_id = $id;
         $round->libelle = $match->libelle;
         $round->equa = $match->equa;
         $round->equb = $match->equb;
         $round->scorea = $match->scorea;
         $round->scoreb = $match->scoreb;
         $round->lien = $match->lien;
         $round->save();
         Artisan::queue('FFTT:Games', ['lien' => $match->lien, 'id' => $round->id]);
     }
 }