Betaspi Grapper Bet365 per sport
This commit is contained in:
1 parent
1ac74e3e4f
commit
676eecd3ca
15 files changed
+513
-356
No files matched your search
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\DbMapper\Tasks\Helper;
|
||||
|
||||
use App\Models\Element;
|
||||
use App\Models\ElementProvider;
|
||||
|
||||
class FindElement
|
||||
{
|
||||
public static function run(&$mapper)
|
||||
{
|
||||
if (isset($mapper['home_id'])) {
|
||||
$mapper['txodds_home_id'] = ElementProvider::where('provider_id', $mapper['provider_id'])
|
||||
->where('provider_element_id', $mapper['home_id'])->value('element_id');
|
||||
}
|
||||
if (! $mapper['txodds_home_id']) {
|
||||
$arr = ExplodeString::grap($mapper['home']);
|
||||
|
||||
$mapper['txodds_home_id'] = Element::where('sport_id', $mapper['sport_id'])
|
||||
->where(function ($query) use ($arr) {
|
||||
foreach ($arr as $str) {
|
||||
$query->where('name', 'like', '%'.$str.'%');
|
||||
}
|
||||
})->value('id');
|
||||
}
|
||||
|
||||
if (isset($mapper['away_id'])) {
|
||||
$mapper['txodds_away_id'] = ElementProvider::where('provider_id', $mapper['provider_id'])
|
||||
->where('provider_element_id', $mapper['away_id'])->value('element_id');
|
||||
}
|
||||
if (! $mapper['txodds_away_id']) {
|
||||
$arr = ExplodeString::grap($mapper['away']);
|
||||
|
||||
$mapper['txodds_away_id'] = Element::where('sport_id', $mapper['sport_id'])
|
||||
->where(function ($query) use ($arr) {
|
||||
foreach ($arr as $str) {
|
||||
$query->where('name', 'like', '%'.$str.'%');
|
||||
}
|
||||
})->value('id');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user