From 882c29299038a921ecee460f631c06e844c8e384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AF=9B=E8=87=AA=E8=B1=AA?= <836001996@qq.com> Date: Mon, 17 Aug 2020 19:03:33 +0800 Subject: [PATCH] Update Validate.php --- src/Validate/Validate.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Validate/Validate.php b/src/Validate/Validate.php index a9c82bd..128958d 100644 --- a/src/Validate/Validate.php +++ b/src/Validate/Validate.php @@ -511,6 +511,9 @@ public function check(array $data, array $rules = [], $prefix = ''): bool case $rule instanceof ValidateRule: $result = $this->checkItem($key, $value, $rule->getRule(), $data, $rule->getTitle() ?: $title, $rule->getMsg()); break; + case is_array($rule) && is_integer(key($rule)): #判断是否是二维数组验证 + $result = $this->checkItem($key, $value, $rule, $data, $title); + break; case is_array($rule): if (!is_array($data[$key])) { $result = $key . "必须为二维数组";