mapper wip
This commit is contained in:
1 parent
7b2894682f
commit
93febce6fb
18 files changed
+45151
-63
No files matched your search
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Services\Tasks\Helper;
|
||||
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\CompetitionGroupProvider;
|
||||
|
||||
class FindGroup
|
||||
{
|
||||
public static function run(&$event)
|
||||
{
|
||||
|
||||
if (isset($event['group_id'])) {
|
||||
$event['txodds_group_id'][] = CompetitionGroupProvider::where('provider_id', $event['provider_id'])
|
||||
->where('provider_group_id', $event['group_id'])->value('competition_group_id');
|
||||
}
|
||||
if (! $event['txodds_group_id']) {
|
||||
$arr = ExplodeString::grap($event['group']);
|
||||
|
||||
$event['txodds_group_id'] = CompetitionGroup::where('sport_id', $event['sport_id'])
|
||||
->where(function ($query) use ($arr) {
|
||||
foreach ($arr as $str) {
|
||||
$query->orwhere('name', 'like', '%'.$str.'%');
|
||||
}
|
||||
})->pluck('id')->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user