添加赔率

This commit is contained in:
hajimi
2026-07-11 11:19:43 +08:00
parent c9ac46faa7
commit 3a5d571e53
29 changed files with 3006 additions and 542 deletions
@@ -97,16 +97,32 @@ class MatchLiveService
return '';
}
public static function getWorldCupLiveCards(): array
public static function getLiveCards(
int $sportType = 0,
string $leagueName = '',
bool $worldCupOnly = false
): array
{
$rows = MatchLive::alias('live')
$query = MatchLive::alias('live')
->join('match m', 'm.id = live.match_id')
->where(['m.is_show' => 1])
->where([['m.status', '<>', 2]])
->where(function ($query) {
$query->where('m.league_name', '世界杯')
->whereOr('m.competition_id', 61);
})
->where([['m.status', '<>', 2]]);
if ($sportType > 0) {
$query->where('m.sport_type', $sportType);
}
if ($leagueName !== '') {
$query->where('m.league_name', $leagueName);
}
if ($worldCupOnly) {
$query
->where(function ($query) {
$query->where('m.league_name', '世界杯')
->whereOr('m.competition_id', 61);
});
}
$rows = $query
->field([
'live.id as live_id',
'live.match_id',
@@ -191,4 +207,9 @@ class MatchLiveService
return $cards;
}
public static function getWorldCupLiveCards(): array
{
return self::getLiveCards(0, '', true);
}
}