添加赔率
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user