feat: wire match live backend api

This commit is contained in:
hajimi
2026-06-21 11:52:02 +08:00
parent 8d528ba5fe
commit 80e0e6a8a6
7 changed files with 329 additions and 1 deletions
@@ -13,6 +13,7 @@ use app\common\model\match\MatchLineup;
use app\common\model\match\WorldCupPersonRanking;
use app\common\model\match\WorldCupStanding;
use app\common\model\league\League;
use app\common\service\match\MatchLiveService;
class MatchController extends BaseApiController
{
@@ -157,6 +158,10 @@ class MatchController extends BaseApiController
return $this->fail('赛事不存在');
}
$data = $match->toArray();
$data['live_list'] = MatchLiveService::getLiveListForApi((int) $data['id']);
if (empty($data['live_url']) && !empty($data['live_list'][0]['source_url'])) {
$data['live_url'] = (string) $data['live_list'][0]['source_url'];
}
if (empty($data['live_url']) && $this->isWorldCupMatch($data)) {
$data['live_url'] = $this->worldCupDefaultLiveUrl;
}