add groups and major groups direct from txodds for auto mapping names
This commit is contained in:
1 parent
ba83e1a12d
commit
859038cc8c
21 files changed
+299
-40
No files matched your search
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\Nuh;
|
||||
use App\Console\Commands\Xml;
|
||||
use App\Models\Group;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
|
||||
class Groups
|
||||
{
|
||||
public static function grap()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$kontos = ['soccer' => config('env.txodds_betaid1'), 'other' => config('env.txodds_betaid2')];
|
||||
|
||||
$sports = Sport::getActiveSports();
|
||||
|
||||
Group::whereNotIn('sport_id', $sports)->delete();
|
||||
|
||||
$years = [date('y'), date('y') + 1];
|
||||
|
||||
foreach ($kontos as $konto => $authentication) {
|
||||
|
||||
$url = 'https://xml2.txodds.com/feed/groups.php?'.$authentication.'&sid='.implode(',', $years);
|
||||
|
||||
$data = Xml::load($url);
|
||||
|
||||
dd($data);
|
||||
|
||||
$count = 0;
|
||||
foreach ($data as $row) {
|
||||
if (in_array()) {
|
||||
Group::updateOrCreate(
|
||||
['id' => (int) $row->id],
|
||||
[
|
||||
'mgroup' => (string) $row->mgroup,
|
||||
'name' => (string) $row->name,
|
||||
'fullname' => (string) $row->fullname,
|
||||
'sid' => (string) $row->sid,
|
||||
'date1' => (string) $row->date1,
|
||||
'date2' => (string) $row->date2,
|
||||
]
|
||||
);
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
|
||||
Notice::note("$count groups $konto processed", 'g');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user