fixtures new wip
This commit is contained in:
1 parent
a1057d55a7
commit
69619802ce
27 files changed
+156
-187
No files matched your search
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Fixtures;
|
||||
|
||||
use App\Models\CompetitionGroupProvider;
|
||||
|
||||
class LoadGroups
|
||||
{
|
||||
public static function load($provider_id, $load_by_name = false)
|
||||
{
|
||||
$res = CompetitionGroupProvider::where('provider_id', $provider_id)->get();
|
||||
|
||||
$r = [];
|
||||
foreach ($res as $val) {
|
||||
if ($load_by_name) {
|
||||
$r[$val->sport_id][$val->name] = $val->competition_group_id;
|
||||
} else {
|
||||
$r[$val->sport_id][$val->provider_group_id] = $val->competition_group_id;
|
||||
}
|
||||
}
|
||||
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user