This commit is contained in:
thinkphp
2017-03-21 14:34:11 +08:00
parent f5f39422e2
commit 8209f9f4b1

View File

@@ -461,7 +461,8 @@ class Validate
*/
protected function egt($value, $rule, $data)
{
return !is_null($this->getDataValue($data, $rule)) && $value >= $this->getDataValue($data, $rule);
$val = $this->getDataValue($data, $rule);
return !is_null($val) && $value >= $val;
}
/**
@@ -474,7 +475,8 @@ class Validate
*/
protected function gt($value, $rule, $data)
{
return !is_null($this->getDataValue($data, $rule)) && $value > $this->getDataValue($data, $rule);
$val = $this->getDataValue($data, $rule);
return !is_null($val) && $value > $val;
}
/**
@@ -487,7 +489,8 @@ class Validate
*/
protected function elt($value, $rule, $data)
{
return !is_null($this->getDataValue($data, $rule)) && $value <= $this->getDataValue($data, $rule);
$val = $this->getDataValue($data, $rule);
return !is_null($val) && $value <= $val;
}
/**
@@ -500,7 +503,8 @@ class Validate
*/
protected function lt($value, $rule, $data)
{
return !is_null($this->getDataValue($data, $rule)) && $value < $this->getDataValue($data, $rule);
$val = $this->getDataValue($data, $rule);
return !is_null($val) && $value < $val;
}
/**