mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 16:12:49 +08:00
改进
This commit is contained in:
@@ -461,7 +461,8 @@ class Validate
|
|||||||
*/
|
*/
|
||||||
protected function egt($value, $rule, $data)
|
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)
|
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)
|
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)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1193,7 +1197,7 @@ class Validate
|
|||||||
if (strpos($key, '.')) {
|
if (strpos($key, '.')) {
|
||||||
// 支持二维数组验证
|
// 支持二维数组验证
|
||||||
list($name1, $name2) = explode('.', $key);
|
list($name1, $name2) = explode('.', $key);
|
||||||
$value = isset($data[$name1][$name2]) ? $data[$name1][$name2] : null;
|
$value = isset($data[$name1][$name2]) ? $data[$name1][$name2] : null;
|
||||||
} else {
|
} else {
|
||||||
$value = is_numeric($key) ? $key : (isset($data[$key]) ? $data[$key] : null);
|
$value = is_numeric($key) ? $key : (isset($data[$key]) ? $data[$key] : null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user