wip matches
This commit is contained in:
1 parent
adb15e701b
commit
7116d3c576
33 files changed
+379
-176
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Models\Element;
|
||||
|
||||
class TxElement
|
||||
{
|
||||
public static function find($element, $sport_id)
|
||||
{
|
||||
|
||||
// dd($element);
|
||||
|
||||
$txodds_id = array_column($element, 'id');
|
||||
|
||||
$element = Element::firstOrCreate([
|
||||
'name' => (string) $element['@text'],
|
||||
'sport_id' => $sport_id,
|
||||
'txodds_id' => (int) $txodds_id[0],
|
||||
]);
|
||||
|
||||
return $element->id;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds;
|
||||
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Models\Country;
|
||||
use App\Models\Liga;
|
||||
|
||||
class TxLigas
|
||||
{
|
||||
public static function find($group)
|
||||
{
|
||||
$debug = NuhBash::$options['debug'] ?? 0;
|
||||
|
||||
$cgid = array_column($group, 'cgid');
|
||||
$cnid = array_column($group, 'cnid');
|
||||
$spid = array_column($group, 'spid');
|
||||
$cname = array_column($group, 'cname');
|
||||
|
||||
$country_id = Country::where('txid', $cnid)->value('id');
|
||||
|
||||
$liga = Liga::firstOrCreate([
|
||||
'name' => (string) $cname[0],
|
||||
'sport_id' => (int) $spid[0],
|
||||
'country_id' => $country_id,
|
||||
'txodds_id' => (int) $cgid[0],
|
||||
]);
|
||||
|
||||
return $liga->id;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user