| @@ 198-206 (lines=9) @@ | ||
| 195 | * @link https://www.elastic.co/guide/en/elasticsearch/reference/5.0/query-dsl-range-query.html | |
| 196 | * @return $this; | |
| 197 | */ | |
| 198 | public function whereBetween($field, $min, $max, $dateFormat = null) | |
| 199 |     { | |
| 200 | $params = ['gte' => $min, 'lte' => $max]; | |
| 201 |         if ($dateFormat) { | |
| 202 | $params['format'] = $dateFormat; | |
| 203 | } | |
| 204 |         $this->addFilter('range',[$field => $params]); | |
| 205 | return $this; | |
| 206 | } | |
| 207 | ||
| 208 | ||
| 209 | /** | |
| @@ 246-254 (lines=9) @@ | ||
| 243 | * @param null $dateFormat | |
| 244 | * @return $this | |
| 245 | */ | |
| 246 | public function whereGreaterOrEqual($field, $value, $dateFormat = null) | |
| 247 |     { | |
| 248 | $params = ['gte' => $value]; | |
| 249 |         if ($dateFormat) { | |
| 250 | $params['format'] = $dateFormat; | |
| 251 | } | |
| 252 |         $this->addFilter('range', [$field => $params]); | |
| 253 | return $this; | |
| 254 | } | |
| 255 | ||
| 256 | /** | |
| 257 | * добавить фильтр "больше чем" | |
| @@ 263-271 (lines=9) @@ | ||
| 260 | * @param null $dateFormat | |
| 261 | * @return $this | |
| 262 | */ | |
| 263 | public function whereGreater($field, $value, $dateFormat = null) | |
| 264 |     { | |
| 265 | $params = ['gt' => $value]; | |
| 266 |         if ($dateFormat) { | |
| 267 | $params['format'] = $dateFormat; | |
| 268 | } | |
| 269 |         $this->addFilter('range', [$field => $params]); | |
| 270 | return $this; | |
| 271 | } | |
| 272 | ||
| 273 | /** | |
| 274 | * добавить фильтр "меньше или равно" | |
| @@ 280-288 (lines=9) @@ | ||
| 277 | * @param null $dateFormat | |
| 278 | * @return $this | |
| 279 | */ | |
| 280 | public function whereLessOrEqual($field, $value, $dateFormat = null) | |
| 281 |     { | |
| 282 | $params = ['lte' => $value]; | |
| 283 |         if ($dateFormat) { | |
| 284 | $params['format'] = $dateFormat; | |
| 285 | } | |
| 286 |         $this->addFilter('range', [$field => $params]); | |
| 287 | return $this; | |
| 288 | } | |
| 289 | ||
| 290 | /** | |
| 291 | * добавить фильтр "меньше чем" | |
| @@ 297-305 (lines=9) @@ | ||
| 294 | * @param null $dateFormat | |
| 295 | * @return $this | |
| 296 | */ | |
| 297 | public function whereLess($field, $value, $dateFormat = null) | |
| 298 |     { | |
| 299 | $params = ['lt' => $value]; | |
| 300 |         if ($dateFormat) { | |
| 301 | $params['format'] = $dateFormat; | |
| 302 | } | |
| 303 |         $this->addFilter('range', [$field => $params]); | |
| 304 | return $this; | |
| 305 | } | |
| 306 | ||
| 307 | ||
| 308 | /** | |