wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Console\Commands\Xml;
|
||||
use App\Models\MajorGroup;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class MajorGroups
|
||||
{
|
||||
public static function grap()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$sports = Sport::getActiveSports();
|
||||
|
||||
foreach ($sports as $name => $sport_id) {
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/mgroups.php?spid='.$sport_id.'&active=1';
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
$count = 0;
|
||||
foreach ($data as $row) {
|
||||
|
||||
MajorGroup::updateOrCreate(
|
||||
['id' => (int) $row->id],
|
||||
[
|
||||
'name' => (string) $row->name,
|
||||
'sport_id' => $sport_id,
|
||||
'country_id' => $row->countryid,
|
||||
]
|
||||
);
|
||||
$count++;
|
||||
}
|
||||
|
||||
Notice::note("$count major groups $name processed", 'g');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user