wip del err
This commit is contained in:
1 parent
812736ca9a
commit
9bcd4432c6
1210 files changed
-220941
No files matched your search
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\DbMapper\Helper;
|
||||
|
||||
use App\Models\Element;
|
||||
use App\Models\ElementProvider;
|
||||
|
||||
class FindElement
|
||||
{
|
||||
public static function run(&$mapper)
|
||||
{
|
||||
if (isset($mapper['home_id']) && $mapper['home_id'] > 0) {
|
||||
$mapper['txodds_home_id'] = ElementProvider::where('provider_id', $mapper['provider_id'])
|
||||
->where('provider_element_id', $mapper['home_id'])->value('element_id');
|
||||
}
|
||||
if (! isset($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['away_id'] > 0) {
|
||||
$mapper['txodds_away_id'] = ElementProvider::where('provider_id', $mapper['provider_id'])
|
||||
->where('provider_element_id', $mapper['away_id'])->value('element_id');
|
||||
}
|
||||
if (! isset($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