Ken преди 1 месец
родител
ревизия
f6bba6aa28
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 8 0
      app/Services/FixtureService.php

+ 8 - 0
app/Services/FixtureService.php

@@ -21,6 +21,14 @@ static function updateOdds()
         foreach ($list['response'] as $item) {
             $sport = Sport::where('data_id', $item['fixture']['id'])->first();
             $sport->odds = json_encode($item['odds']);
+            $sport->state = 1;
+            $score = $item['teams']['home']['goals'];
+            $score .= "-";
+            $score .= $item['teams']['away']['goals'];
+            if ($item['fixture']['status']['long'] == 'First Half') {
+                $sport->half_score = $score;
+            }
+            $sport->score = $score;
             $sport->save();
         }
     }