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
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Console\Commands\DbMapper\Helper;
|
||||
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\CompetitionGroupProvider;
|
||||
use App\Models\Group;
|
||||
|
||||
class FindGroup
|
||||
{
|
||||
@@ -17,12 +17,16 @@ class FindGroup
|
||||
if (! $mapper['txodds_group_id']) {
|
||||
$arr = ExplodeString::grap($mapper['group']);
|
||||
|
||||
$mapper['txodds_group_id'] = CompetitionGroup::where('sport_id', $mapper['sport_id'])
|
||||
$arr = array_diff($arr, ['Singles', 'ATP', 'WTA']);
|
||||
|
||||
print_r($arr);
|
||||
|
||||
$mapper['competition_group_id'] = Group::where('sport_id', $mapper['sport_id'])
|
||||
->where(function ($query) use ($arr) {
|
||||
foreach ($arr as $str) {
|
||||
$query->where('name', 'like', '%'.$str.'%');
|
||||
}
|
||||
})->value('id');
|
||||
})->value('competition_group_id');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user