wip countries
This commit is contained in:
1 parent
641b362752
commit
1b9a65b25a
23 files changed
+127755
-27137
No files matched your search
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
|
||||
|
||||
use App\Models\Country;
|
||||
|
||||
class TxCountries
|
||||
{
|
||||
public static function get($group)
|
||||
{
|
||||
|
||||
// "group": {
|
||||
// "@attributes": {
|
||||
// "id": "177425",
|
||||
// "cgid": "336",
|
||||
// "spid": "1",
|
||||
// "cnid": "381",
|
||||
// "mgid": "1373",
|
||||
// "cname": "UEFA Women's Champions League"
|
||||
// },
|
||||
// "@text": "WFBECUP UEFA Women's Champions League > Qualifying Rounds-25"
|
||||
// },
|
||||
|
||||
$cnid = array_column($group, 'cnid');
|
||||
$cname = array_column($group, 'cname');
|
||||
|
||||
$country = Country::firstOrCreate(
|
||||
['txid' => $cnid[0]],
|
||||
['name' => $cname[0]]
|
||||
);
|
||||
|
||||
return $cnid[0];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
|
||||
|
||||
use App\Models\Country;
|
||||
|
||||
class TxCountry
|
||||
{
|
||||
public static function find($group)
|
||||
{
|
||||
|
||||
$cnid = array_column($group, 'cnid');
|
||||
$cname = array_column($group, 'cname');
|
||||
|
||||
$country = Country::firstOrCreate(
|
||||
['txid' => $cnid[0]],
|
||||
['name' => $cname[0]]
|
||||
);
|
||||
|
||||
return $country->id;
|
||||
}
|
||||
}
|
||||
+2
-7
@@ -2,18 +2,14 @@
|
||||
|
||||
namespace App\Console\Commands\Grapper\TxOdds\Fixtures;
|
||||
|
||||
use App\Console\Commands\NuhBash;
|
||||
use App\Models\Liga;
|
||||
|
||||
class TxLigas
|
||||
class TxLiga
|
||||
{
|
||||
public static function find($group)
|
||||
public static function find($country_id, $group)
|
||||
{
|
||||
$debug = NuhBash::$options['debug'] ?? 0;
|
||||
|
||||
$cname = array_column($group, 'cname');
|
||||
$spid = array_column($group, 'spid');
|
||||
$country_id = TxCountries::get($group);
|
||||
$cgid = array_column($group, 'cgid');
|
||||
|
||||
$liga = Liga::firstOrCreate([
|
||||
@@ -24,6 +20,5 @@ class TxLigas
|
||||
]);
|
||||
|
||||
return $liga->id;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user