From e6c7bb48058b8770d8452ac62421ae3b87e612e1 Mon Sep 17 00:00:00 2001 From: huangbule Date: Tue, 23 Apr 2024 15:31:23 +0800 Subject: [PATCH] fixbug --- src/Traits/FilterTrait.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Traits/FilterTrait.php b/src/Traits/FilterTrait.php index 74dadff..9870bf1 100644 --- a/src/Traits/FilterTrait.php +++ b/src/Traits/FilterTrait.php @@ -204,7 +204,9 @@ private function halfOpenFilter($qr, $column, $param) if (count($arr) != 2) throw new InvalidArgumentException($column . " corresponding values must be throughput or comma separated."); - return $qr->where($column, '>=', $arr[0])->where($column, '<', $arr[1]); + if (!empty($arr[0]) && !empty($arr[1])) { + return $qr->where($column, '>=', $arr[0])->where($column, '<', $arr[1]); + } } }