deploy: auto commit repo-root changes 2026-07-11 12:03:08

This commit is contained in:
hajimi
2026-07-11 12:03:08 +08:00
parent 3a5d571e53
commit 42d243971e
3 changed files with 94 additions and 19 deletions
+32 -2
View File
@@ -535,6 +535,7 @@ class MatchController extends BaseApiController
$this->request->get('sport_type/d', 0),
trim($this->request->get('league_name/s', ''))
),
'platform_options' => $this->getOddsPlatformOptions(),
]);
}
@@ -552,6 +553,7 @@ class MatchController extends BaseApiController
'',
true
),
'platform_options' => $this->getOddsPlatformOptions(),
]);
}
@@ -795,11 +797,39 @@ class MatchController extends BaseApiController
private function resolveOddsPlatformName(string $sourceSite): string
{
$map = [
$map = $this->getOddsPlatformNameMap();
return $map[$sourceSite] ?? ($sourceSite !== '' ? strtoupper($sourceSite) : '平台');
}
private function getOddsPlatformNameMap(): array
{
return [
'hg' => '滚球',
'titan007' => '球探',
];
return $map[$sourceSite] ?? ($sourceSite !== '' ? strtoupper($sourceSite) : '平台');
}
private function getOddsPlatformOptions(): array
{
$platformMap = $this->getOddsPlatformNameMap();
$sourceSites = MatchOdds::where('source_site', '<>', '')
->group('source_site')
->column('source_site');
foreach ($sourceSites as $sourceSite) {
$sourceSite = strtolower(trim((string)$sourceSite));
if ($sourceSite !== '' && !isset($platformMap[$sourceSite])) {
$platformMap[$sourceSite] = strtoupper($sourceSite);
}
}
$options = [];
foreach ($platformMap as $key => $label) {
$options[] = [
'key' => $key,
'label' => $label,
];
}
return $options;
}
private function resolveOddsShowTypeText(string $showType): string
@@ -97,16 +97,11 @@ class MatchLiveService
return '';
}
public static function getLiveCards(
int $sportType = 0,
string $leagueName = '',
bool $worldCupOnly = false
): array
public static function getLiveCards(int $sportType = 0, string $leagueName = ''): array
{
$query = MatchLive::alias('live')
->join('match m', 'm.id = live.match_id')
->where(['m.is_show' => 1])
->where([['m.status', '<>', 2]]);
->leftJoin('match m', 'm.id = live.match_id')
->where('live.fetch_status', 1);
if ($sportType > 0) {
$query->where('m.sport_type', $sportType);
@@ -114,13 +109,6 @@ class MatchLiveService
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([
@@ -210,6 +198,6 @@ class MatchLiveService
public static function getWorldCupLiveCards(): array
{
return self::getLiveCards(0, '', true);
return self::getLiveCards();
}
}