@@ -91,17 +91,17 @@ |
||
| 91 | 91 | $this->setSearchClosure('cross', function (...$attributes) use ($crossMin, $crossMax) { |
| 92 | 92 | return $attributes[0]->where(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
| 93 | 93 | $query->where("{$attributes[2]}_{$crossMin}", '<=', (int) $attributes[3][0]) |
| 94 | - ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][1]); |
|
| 94 | + ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][1]); |
|
| 95 | 95 | })->orWhere(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
| 96 | 96 | $query->where("{$attributes[2]}_{$crossMin}", '<=', (int) $attributes[3][0]) |
| 97 | - ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][0]); |
|
| 97 | + ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][0]); |
|
| 98 | 98 | })->orWhere(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
| 99 | 99 | $query->where("{$attributes[2]}_{$crossMin}", '>=', (int) $attributes[3][0]) |
| 100 | - ->where("{$attributes[2]}_{$crossMax}", '<=', (int) $attributes[3][1]); |
|
| 100 | + ->where("{$attributes[2]}_{$crossMax}", '<=', (int) $attributes[3][1]); |
|
| 101 | 101 | })->orWhere(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
| 102 | 102 | $query->where("{$attributes[2]}_{$crossMin}", '>=', (int) $attributes[3][0]) |
| 103 | - ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][1]) |
|
| 104 | - ->where("{$attributes[2]}_{$crossMin}", '<=', (int) $attributes[3][1]); |
|
| 103 | + ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][1]) |
|
| 104 | + ->where("{$attributes[2]}_{$crossMin}", '<=', (int) $attributes[3][1]); |
|
| 105 | 105 | }); |
| 106 | 106 | }); |
| 107 | 107 | } |
@@ -88,17 +88,17 @@ discard block |
||
| 88 | 88 | $crossMin = config('repository.criteria.cross.min', 'min'); |
| 89 | 89 | $crossMax = config('repository.criteria.cross.min', 'max'); |
| 90 | 90 | |
| 91 | - $this->setSearchClosure('cross', function (...$attributes) use ($crossMin, $crossMax) { |
|
| 92 | - return $attributes[0]->where(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 91 | + $this->setSearchClosure('cross', function(...$attributes) use ($crossMin, $crossMax) { |
|
| 92 | + return $attributes[0]->where(function(Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 93 | 93 | $query->where("{$attributes[2]}_{$crossMin}", '<=', (int) $attributes[3][0]) |
| 94 | 94 | ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][1]); |
| 95 | - })->orWhere(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 95 | + })->orWhere(function(Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 96 | 96 | $query->where("{$attributes[2]}_{$crossMin}", '<=', (int) $attributes[3][0]) |
| 97 | 97 | ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][0]); |
| 98 | - })->orWhere(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 98 | + })->orWhere(function(Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 99 | 99 | $query->where("{$attributes[2]}_{$crossMin}", '>=', (int) $attributes[3][0]) |
| 100 | 100 | ->where("{$attributes[2]}_{$crossMax}", '<=', (int) $attributes[3][1]); |
| 101 | - })->orWhere(function (Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 101 | + })->orWhere(function(Builder $query) use ($attributes, $crossMin, $crossMax) { |
|
| 102 | 102 | $query->where("{$attributes[2]}_{$crossMin}", '>=', (int) $attributes[3][0]) |
| 103 | 103 | ->where("{$attributes[2]}_{$crossMax}", '>=', (int) $attributes[3][1]) |
| 104 | 104 | ->where("{$attributes[2]}_{$crossMin}", '<=', (int) $attributes[3][1]); |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | protected function setBetweenSearchClosure() |
| 110 | 110 | { |
| 111 | - $this->setSearchClosure('between', function (...$attributes) { |
|
| 111 | + $this->setSearchClosure('between', function(...$attributes) { |
|
| 112 | 112 | return $attributes[0]->whereBetween($attributes[2], $attributes[3]); |
| 113 | 113 | }); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | protected function setInSearchClosure() |
| 117 | 117 | { |
| 118 | - $this->setSearchClosure('in', function (...$attributes) { |
|
| 118 | + $this->setSearchClosure('in', function(...$attributes) { |
|
| 119 | 119 | return $attributes[0]->whereIn($attributes[2], $attributes[3]); |
| 120 | 120 | }); |
| 121 | 121 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | protected function parseSearchAndRelationClosure($value, $relation, $field, $condition) |
| 65 | 65 | { |
| 66 | - $this->model = $this->model->whereHas($relation, function (Builder $query) use ($condition, $field, $value) { |
|
| 66 | + $this->model = $this->model->whereHas($relation, function(Builder $query) use ($condition, $field, $value) { |
|
| 67 | 67 | if (is_array($this->searchClosures) && Arr::has($this->searchClosures, $condition)) { |
| 68 | 68 | $this->searchClosures[$condition]($query, $condition, $field, $value); |
| 69 | 69 | } else { |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | protected function parseSearchOrRelationClosure($value, $relation, $field, $condition) |
| 94 | 94 | { |
| 95 | - $this->model = $this->model->orWhereHas($relation, function (Builder $query) use ($field, $condition, $value) { |
|
| 95 | + $this->model = $this->model->orWhereHas($relation, function(Builder $query) use ($field, $condition, $value) { |
|
| 96 | 96 | if (is_array($this->searchClosures) && Arr::has($this->searchClosures, $condition)) { |
| 97 | 97 | $this->searchClosures[$condition]($query, $condition, $field, $value); |
| 98 | 98 | } else { |