getZqScore(); if (!$scores) { return; } foreach ($scores as $item) { $id = $item['id']; $match = JczqScore::withTrashed()->select('id')->where('score_id', $id)->first(); if (!$match) { $match = new JczqScore(); } $match->score_id = $id; $match->match_id = intval(Arr::get($item, 'matchId')); $match->elapsed = strval(Arr::get($item, 'elapsed')); $match->status = intval(Arr::get($item, 'status')); $match->period = intval(Arr::get($item, 'period')); $match->score = strval(Arr::get($item, 'score')); $match->half_time_score = strval(Arr::get($item, 'halfTimeScore')); $match->full_time_score = strval(Arr::get($item, 'fullTimeScore')); $match->extra_time_score = strval(Arr::get($item, 'extraTimeScore')); $match->penal_score = strval(Arr::get($item, 'penalScore')); $match->win_team_id = intval(Arr::get($item, 'winTeamId')); $match->home_team_red_cards = intval(Arr::get($item, 'homeTeamRedNum')); $match->away_team_red_cards = intval(Arr::get($item, 'awayTeamRedNum')); $match->save(); } } }