Files
nuhodds_fi4/app/Console/Commands/DbMapper/Helper/FindCountry.php
T

45 lines
1.2 KiB
PHP

<?php
namespace App\Console\Commands\DbMapper\Tasks\Helper;
use App\Models\CountriesItalian;
use App\Models\Country;
class FindCountry
{
public static function run(&$event)
{
if ($event['provider_id'] == 10) {
// GOLDBET
$country = CountriesItalian::where('it', $event['country'])->value('en');
$event['txodds_country_id'] = Country::where('name', $country)->value('id');
} else {
$country = self::fix_country($event['country']);
$event['txodds_country_id'] = Country::where('name', $country)->value('id');
}
}
public static function fix_country($country)
{
switch ($country) {
case 'Internazionale':
case 'International Club':
case 'Internazionali Di Club':
case 'FIBA Intercontinental Cup':
return 'International';
case 'Euro Cup':
case 'Euro Cup Women':
case 'Euroleague':
case 'Euroleague Women':
return 'Europe';
case 'WNBA':
return 'USA';
default:
return $country;
}
}
}