feat: wire match live backend api
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user