|
@@ -133,14 +133,14 @@ class WhereBuilder implements \ArrayAccess
|
|
|
|
|
|
public function between($column, $left, $right, $when = false)
|
|
public function between($column, $left, $right, $when = false)
|
|
{
|
|
{
|
|
- if ($when || (self::empty($left) && self::empty($right))) {
|
|
|
|
|
|
+ if ($when || (self::exist($left) && self::exist($right))) {
|
|
$this->where($column, 'between', [$left, $right]);
|
|
$this->where($column, 'between', [$left, $right]);
|
|
return $this;
|
|
return $this;
|
|
- } elseif (self::empty($left) && !self::empty($right)) {
|
|
|
|
|
|
+ } elseif (self::exist($left) && !self::exist($right)) {
|
|
$this->where($column, '>=', $left);
|
|
$this->where($column, '>=', $left);
|
|
return $this;
|
|
return $this;
|
|
- } elseif (!self::empty($left) && self::empty($right)) {
|
|
|
|
- $this->where($column, '<=', $left);
|
|
|
|
|
|
+ } elseif (!self::exist($left) && self::exist($right)) {
|
|
|
|
+ $this->where($column, '<=', $right);
|
|
return $this;
|
|
return $this;
|
|
} else {
|
|
} else {
|
|
return $this;
|
|
return $this;
|
|
@@ -197,7 +197,7 @@ class WhereBuilder implements \ArrayAccess
|
|
return isset($this->where[$offset]) ? $this->where[$offset] : null;
|
|
return isset($this->where[$offset]) ? $this->where[$offset] : null;
|
|
}
|
|
}
|
|
|
|
|
|
- private static function empty($condition)
|
|
|
|
|
|
+ private static function exist($condition)
|
|
{
|
|
{
|
|
$valid = false;
|
|
$valid = false;
|
|
if (is_int($condition)) {
|
|
if (is_int($condition)) {
|