fix flags
This commit is contained in:
1 parent
2cdc70f5a4
commit
7acb1375d4
11 files changed
+1035
-14
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Mapper;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\Mapper;
|
||||
|
||||
class LoadMapper
|
||||
{
|
||||
public static function load($search_values)
|
||||
{
|
||||
|
||||
$res = Event::query()->where('betradar_id', '>', 0)->pluck('betradar_id');
|
||||
|
||||
foreach ($res as $betradar_id) {
|
||||
Mapper::where('betradar_id', $betradar_id)->delete();
|
||||
}
|
||||
|
||||
if (is_array($search_values) and \count($search_values)) {
|
||||
|
||||
return Mapper::query()
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('provider_id', auth()->user()->provider_id)
|
||||
->where(function ($query) use ($search_values) {
|
||||
foreach ($search_values as $value) {
|
||||
$query->orWhere('home', 'LIKE', '%'.$value.'%')
|
||||
->orWhere('away', 'LIKE', '%'.$value.'%');
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
return Mapper::query()
|
||||
->with('country_magloo')
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('provider_id', auth()->user()->provider_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user