wip
This commit is contained in:
1 parent
b4122036ff
commit
d356db1d8b
1 file changed
+4
-4
@@ -8,7 +8,7 @@ use Illuminate\Support\Carbon;
|
|||||||
|
|
||||||
class LoadProvider
|
class LoadProvider
|
||||||
{
|
{
|
||||||
public static function load($search_right, $user)
|
public static function load($search_values, $user)
|
||||||
{
|
{
|
||||||
|
|
||||||
$res = Event::query()->where('betradar_id', '>', 0)->pluck('betradar_id');
|
$res = Event::query()->where('betradar_id', '>', 0)->pluck('betradar_id');
|
||||||
@@ -16,14 +16,14 @@ class LoadProvider
|
|||||||
Mapper::where('betradar_id', $betradar_id)->delete();
|
Mapper::where('betradar_id', $betradar_id)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_right) {
|
if (is_array($search_values) and \count($search_values)) {
|
||||||
|
|
||||||
return Mapper::query()
|
return Mapper::query()
|
||||||
->where('starttime', '>', Carbon::now())
|
->where('starttime', '>', Carbon::now())
|
||||||
->where('sport_id', $user->sport_id)
|
->where('sport_id', $user->sport_id)
|
||||||
->where('provider_id', $user->provider_id)
|
->where('provider_id', $user->provider_id)
|
||||||
->where(function ($query) use ($search_right) {
|
->where(function ($query) use ($search_values) {
|
||||||
foreach ($search_right as $value) {
|
foreach ($search_values as $value) {
|
||||||
$query->orWhere('home', 'LIKE', '%'.$value.'%')
|
$query->orWhere('home', 'LIKE', '%'.$value.'%')
|
||||||
->orWhere('away', 'LIKE', '%'.$value.'%');
|
->orWhere('away', 'LIKE', '%'.$value.'%');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user