@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $this->model = $this->model->leftJoin($sortTable, $keyName, '=', $sortTable.'.id') |
| 168 | - ->orderBy($sortColumn, $this->sortedBy) |
|
| 169 | - ->addSelect($table.'.*'); |
|
| 168 | + ->orderBy($sortColumn, $this->sortedBy) |
|
| 169 | + ->addSelect($table.'.*'); |
|
| 170 | 170 | } else { |
| 171 | 171 | $this->model = $this->model->orderBy($this->orderBy, $this->sortedBy); |
| 172 | 172 | } |
@@ -259,17 +259,17 @@ discard block |
||
| 259 | 259 | $query->where(function (Builder $query) use ($field, $value) { |
| 260 | 260 | $query->where(function (Builder $query) use ($field, $value) { |
| 261 | 261 | $query->where("{$field}_min", '<=', $value[0]) |
| 262 | - ->where("{$field}_max", '>=', $value[1]); |
|
| 262 | + ->where("{$field}_max", '>=', $value[1]); |
|
| 263 | 263 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 264 | 264 | $query->where("{$field}_min", '<=', $value[0]) |
| 265 | - ->where("{$field}_max", '>=', $value[0]); |
|
| 265 | + ->where("{$field}_max", '>=', $value[0]); |
|
| 266 | 266 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 267 | 267 | $query->where("{$field}_min", '>=', $value[0]) |
| 268 | - ->where("{$field}_max", '<=', $value[1]); |
|
| 268 | + ->where("{$field}_max", '<=', $value[1]); |
|
| 269 | 269 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 270 | 270 | $query->where("{$field}_min", '>=', $value[0]) |
| 271 | - ->where("{$field}_max", '>=', $value[1]) |
|
| 272 | - ->where("{$field}_min", '<=', $value[1]); |
|
| 271 | + ->where("{$field}_max", '>=', $value[1]) |
|
| 272 | + ->where("{$field}_min", '<=', $value[1]); |
|
| 273 | 273 | }); |
| 274 | 274 | }); |
| 275 | 275 | } else { |
@@ -285,17 +285,17 @@ discard block |
||
| 285 | 285 | $this->model = $this->model->where(function (Builder $query) use ($field, $value) { |
| 286 | 286 | $query->where(function (Builder $query) use ($field, $value) { |
| 287 | 287 | $query->where("{$field}_min", '<=', $value[0]) |
| 288 | - ->where("{$field}_max", '>=', $value[1]); |
|
| 288 | + ->where("{$field}_max", '>=', $value[1]); |
|
| 289 | 289 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 290 | 290 | $query->where("{$field}_min", '<=', $value[0]) |
| 291 | - ->where("{$field}_max", '>=', $value[0]); |
|
| 291 | + ->where("{$field}_max", '>=', $value[0]); |
|
| 292 | 292 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 293 | 293 | $query->where("{$field}_min", '>=', $value[0]) |
| 294 | - ->where("{$field}_max", '<=', $value[1]); |
|
| 294 | + ->where("{$field}_max", '<=', $value[1]); |
|
| 295 | 295 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 296 | 296 | $query->where("{$field}_min", '>=', $value[0]) |
| 297 | - ->where("{$field}_max", '>=', $value[1]) |
|
| 298 | - ->where("{$field}_min", '<=', $value[1]); |
|
| 297 | + ->where("{$field}_max", '>=', $value[1]) |
|
| 298 | + ->where("{$field}_min", '<=', $value[1]); |
|
| 299 | 299 | }); |
| 300 | 300 | }); |
| 301 | 301 | } else { |
@@ -320,17 +320,17 @@ discard block |
||
| 320 | 320 | $query->where(function (Builder $query) use ($field, $value) { |
| 321 | 321 | $query->where(function (Builder $query) use ($field, $value) { |
| 322 | 322 | $query->where("{$field}_min", '<=', $value[0]) |
| 323 | - ->where("{$field}_max", '>=', $value[1]); |
|
| 323 | + ->where("{$field}_max", '>=', $value[1]); |
|
| 324 | 324 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 325 | 325 | $query->where("{$field}_min", '<=', $value[0]) |
| 326 | - ->where("{$field}_max", '>=', $value[0]); |
|
| 326 | + ->where("{$field}_max", '>=', $value[0]); |
|
| 327 | 327 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 328 | 328 | $query->where("{$field}_min", '>=', $value[0]) |
| 329 | - ->where("{$field}_max", '<=', $value[1]); |
|
| 329 | + ->where("{$field}_max", '<=', $value[1]); |
|
| 330 | 330 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 331 | 331 | $query->where("{$field}_min", '>=', $value[0]) |
| 332 | - ->where("{$field}_max", '>=', $value[1]) |
|
| 333 | - ->where("{$field}_min", '<=', $value[1]); |
|
| 332 | + ->where("{$field}_max", '>=', $value[1]) |
|
| 333 | + ->where("{$field}_min", '<=', $value[1]); |
|
| 334 | 334 | }); |
| 335 | 335 | }); |
| 336 | 336 | } else { |
@@ -346,17 +346,17 @@ discard block |
||
| 346 | 346 | $this->model = $this->model->orWhere(function (Builder $query) use ($field, $value) { |
| 347 | 347 | $query->where(function (Builder $query) use ($field, $value) { |
| 348 | 348 | $query->where("{$field}_min", '<=', $value[0]) |
| 349 | - ->where("{$field}_max", '>=', $value[1]); |
|
| 349 | + ->where("{$field}_max", '>=', $value[1]); |
|
| 350 | 350 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 351 | 351 | $query->where("{$field}_min", '<=', $value[0]) |
| 352 | - ->where("{$field}_max", '>=', $value[0]); |
|
| 352 | + ->where("{$field}_max", '>=', $value[0]); |
|
| 353 | 353 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 354 | 354 | $query->where("{$field}_min", '>=', $value[0]) |
| 355 | - ->where("{$field}_max", '<=', $value[1]); |
|
| 355 | + ->where("{$field}_max", '<=', $value[1]); |
|
| 356 | 356 | })->orWhere(function (Builder $query) use ($field, $value) { |
| 357 | 357 | $query->where("{$field}_min", '>=', $value[0]) |
| 358 | - ->where("{$field}_max", '>=', $value[1]) |
|
| 359 | - ->where("{$field}_min", '<=', $value[1]); |
|
| 358 | + ->where("{$field}_max", '>=', $value[1]) |
|
| 359 | + ->where("{$field}_min", '<=', $value[1]); |
|
| 360 | 360 | }); |
| 361 | 361 | }); |
| 362 | 362 | } else { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | if ($this->isFirstField || $this->modelForceAndWhere) { |
| 247 | 247 | if (!is_null($value)) { |
| 248 | 248 | if (!is_null($relation)) { |
| 249 | - $this->model = $this->model->whereHas($relation, function (Builder $query) use ( |
|
| 249 | + $this->model = $this->model->whereHas($relation, function(Builder $query) use ( |
|
| 250 | 250 | $field, |
| 251 | 251 | $condition, |
| 252 | 252 | $value |
@@ -256,17 +256,17 @@ discard block |
||
| 256 | 256 | } elseif ($condition == 'between') { |
| 257 | 257 | $query->whereBetween($field, $value); |
| 258 | 258 | } elseif ($condition == 'cross') { |
| 259 | - $query->where(function (Builder $query) use ($field, $value) { |
|
| 260 | - $query->where(function (Builder $query) use ($field, $value) { |
|
| 259 | + $query->where(function(Builder $query) use ($field, $value) { |
|
| 260 | + $query->where(function(Builder $query) use ($field, $value) { |
|
| 261 | 261 | $query->where("{$field}_min", '<=', $value[0]) |
| 262 | 262 | ->where("{$field}_max", '>=', $value[1]); |
| 263 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 263 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 264 | 264 | $query->where("{$field}_min", '<=', $value[0]) |
| 265 | 265 | ->where("{$field}_max", '>=', $value[0]); |
| 266 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 266 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 267 | 267 | $query->where("{$field}_min", '>=', $value[0]) |
| 268 | 268 | ->where("{$field}_max", '<=', $value[1]); |
| 269 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 269 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 270 | 270 | $query->where("{$field}_min", '>=', $value[0]) |
| 271 | 271 | ->where("{$field}_max", '>=', $value[1]) |
| 272 | 272 | ->where("{$field}_min", '<=', $value[1]); |
@@ -282,17 +282,17 @@ discard block |
||
| 282 | 282 | } elseif ($condition == 'between') { |
| 283 | 283 | $this->model = $this->model->whereBetween($field, $value); |
| 284 | 284 | } elseif ($condition == 'cross') { |
| 285 | - $this->model = $this->model->where(function (Builder $query) use ($field, $value) { |
|
| 286 | - $query->where(function (Builder $query) use ($field, $value) { |
|
| 285 | + $this->model = $this->model->where(function(Builder $query) use ($field, $value) { |
|
| 286 | + $query->where(function(Builder $query) use ($field, $value) { |
|
| 287 | 287 | $query->where("{$field}_min", '<=', $value[0]) |
| 288 | 288 | ->where("{$field}_max", '>=', $value[1]); |
| 289 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 289 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 290 | 290 | $query->where("{$field}_min", '<=', $value[0]) |
| 291 | 291 | ->where("{$field}_max", '>=', $value[0]); |
| 292 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 292 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 293 | 293 | $query->where("{$field}_min", '>=', $value[0]) |
| 294 | 294 | ->where("{$field}_max", '<=', $value[1]); |
| 295 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 295 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 296 | 296 | $query->where("{$field}_min", '>=', $value[0]) |
| 297 | 297 | ->where("{$field}_max", '>=', $value[1]) |
| 298 | 298 | ->where("{$field}_min", '<=', $value[1]); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | } else { |
| 308 | 308 | if (!is_null($value)) { |
| 309 | 309 | if (!is_null($relation)) { |
| 310 | - $this->model = $this->model->orWhereHas($relation, function (Builder $query) use ( |
|
| 310 | + $this->model = $this->model->orWhereHas($relation, function(Builder $query) use ( |
|
| 311 | 311 | $field, |
| 312 | 312 | $condition, |
| 313 | 313 | $value |
@@ -317,17 +317,17 @@ discard block |
||
| 317 | 317 | } elseif ($condition == 'between') { |
| 318 | 318 | $query->whereBetween($field, $value); |
| 319 | 319 | } elseif ($condition == 'cross') { |
| 320 | - $query->where(function (Builder $query) use ($field, $value) { |
|
| 321 | - $query->where(function (Builder $query) use ($field, $value) { |
|
| 320 | + $query->where(function(Builder $query) use ($field, $value) { |
|
| 321 | + $query->where(function(Builder $query) use ($field, $value) { |
|
| 322 | 322 | $query->where("{$field}_min", '<=', $value[0]) |
| 323 | 323 | ->where("{$field}_max", '>=', $value[1]); |
| 324 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 324 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 325 | 325 | $query->where("{$field}_min", '<=', $value[0]) |
| 326 | 326 | ->where("{$field}_max", '>=', $value[0]); |
| 327 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 327 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 328 | 328 | $query->where("{$field}_min", '>=', $value[0]) |
| 329 | 329 | ->where("{$field}_max", '<=', $value[1]); |
| 330 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 330 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 331 | 331 | $query->where("{$field}_min", '>=', $value[0]) |
| 332 | 332 | ->where("{$field}_max", '>=', $value[1]) |
| 333 | 333 | ->where("{$field}_min", '<=', $value[1]); |
@@ -343,17 +343,17 @@ discard block |
||
| 343 | 343 | } elseif ($condition == 'between') { |
| 344 | 344 | $this->model = $this->model->orWhereBetween($modelTableName.'.'.$field, $value); |
| 345 | 345 | } elseif ($condition == 'cross') { |
| 346 | - $this->model = $this->model->orWhere(function (Builder $query) use ($field, $value) { |
|
| 347 | - $query->where(function (Builder $query) use ($field, $value) { |
|
| 346 | + $this->model = $this->model->orWhere(function(Builder $query) use ($field, $value) { |
|
| 347 | + $query->where(function(Builder $query) use ($field, $value) { |
|
| 348 | 348 | $query->where("{$field}_min", '<=', $value[0]) |
| 349 | 349 | ->where("{$field}_max", '>=', $value[1]); |
| 350 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 350 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 351 | 351 | $query->where("{$field}_min", '<=', $value[0]) |
| 352 | 352 | ->where("{$field}_max", '>=', $value[0]); |
| 353 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 353 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 354 | 354 | $query->where("{$field}_min", '>=', $value[0]) |
| 355 | 355 | ->where("{$field}_max", '<=', $value[1]); |
| 356 | - })->orWhere(function (Builder $query) use ($field, $value) { |
|
| 356 | + })->orWhere(function(Builder $query) use ($field, $value) { |
|
| 357 | 357 | $query->where("{$field}_min", '>=', $value[0]) |
| 358 | 358 | ->where("{$field}_max", '>=', $value[1]) |
| 359 | 359 | ->where("{$field}_min", '<=', $value[1]); |