|
@@ -98,6 +98,9 @@ class Sport extends Command
|
|
|
if ($this->is_live == 0) {
|
|
if ($this->is_live == 0) {
|
|
|
//未开始的赛事拉取
|
|
//未开始的赛事拉取
|
|
|
$this->fixtures();
|
|
$this->fixtures();
|
|
|
|
|
+
|
|
|
|
|
+ //世界杯赛事拉取
|
|
|
|
|
+ $this->leagueFixtures();
|
|
|
} elseif ($this->is_live == 1) {
|
|
} elseif ($this->is_live == 1) {
|
|
|
//进行中的赛事,定时更新
|
|
//进行中的赛事,定时更新
|
|
|
$this->liveFixtures();
|
|
$this->liveFixtures();
|
|
@@ -111,6 +114,17 @@ class Sport extends Command
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function leagueFixtures()
|
|
|
|
|
+ {
|
|
|
|
|
+ //体育赛事结束前几(分钟)锁盘,90分钟结束
|
|
|
|
|
+ $sport_locked = Config::where('field', 'sport_locked')->first()->val ?? 1;
|
|
|
|
|
+ //查询世界杯的赛事
|
|
|
|
|
+ $data = SportClientService::fixtures(['league' => 1, 'season' => 2026]);
|
|
|
|
|
+ //file_put_contents('leagueFixtures.json', json_encode($data));
|
|
|
|
|
+ $this->updateOrCreateSport($data, $sport_locked);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//到了比赛开始时间,但是状态还是未开始,检查比赛
|
|
//到了比赛开始时间,但是状态还是未开始,检查比赛
|
|
|
public function checkOvertimeFixtures()
|
|
public function checkOvertimeFixtures()
|
|
|
{
|
|
{
|
|
@@ -243,6 +257,15 @@ class Sport extends Command
|
|
|
$sport_data['league'] = SportLeague::getLeagueName($sport_data['league_id']);
|
|
$sport_data['league'] = SportLeague::getLeagueName($sport_data['league_id']);
|
|
|
$tableData[] = $sport_data;
|
|
$tableData[] = $sport_data;
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ if (empty($info['league'])) {
|
|
|
|
|
+ $sport_data['league'] = SportLeague::getLeagueName($sport_data['league_id']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (empty($info['home_team'])) {
|
|
|
|
|
+ $sport_data['home_team'] = SportTeam::getTeamName($sport_data['home_team_id']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (empty($info['guest_team'])) {
|
|
|
|
|
+ $sport_data['guest_team'] = SportTeam::getTeamName($sport_data['guest_team_id']);
|
|
|
|
|
+ }
|
|
|
SportModel::where('data_id', $item['fixture']['id'])->update($sport_data);
|
|
SportModel::where('data_id', $item['fixture']['id'])->update($sport_data);
|
|
|
}
|
|
}
|
|
|
|
|
|