mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 07:32:48 +08:00
修正traits\model\Auto
This commit is contained in:
@@ -74,7 +74,7 @@ class Validate
|
|||||||
// 不满足自动验证条件
|
// 不满足自动验证条件
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$result = true;
|
|
||||||
if ($val instanceof \Closure) {
|
if ($val instanceof \Closure) {
|
||||||
// 匿名函数验证 支持传入当前字段和所有字段两个数据
|
// 匿名函数验证 支持传入当前字段和所有字段两个数据
|
||||||
$result = self::callback($value, $val, $data);
|
$result = self::callback($value, $val, $data);
|
||||||
@@ -85,6 +85,7 @@ class Validate
|
|||||||
// 验证字段规则
|
// 验证字段规则
|
||||||
$result = self::checkItem($value, $val, $data);
|
$result = self::checkItem($value, $val, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true !== $result) {
|
if (true !== $result) {
|
||||||
// 没有返回true 则表示验证失败
|
// 没有返回true 则表示验证失败
|
||||||
if (!empty($options['patch'])) {
|
if (!empty($options['patch'])) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace traits\model;
|
namespace traits\model;
|
||||||
|
|
||||||
|
use think\Config;
|
||||||
use think\Lang;
|
use think\Lang;
|
||||||
|
|
||||||
trait Auto
|
trait Auto
|
||||||
|
|||||||
Reference in New Issue
Block a user