改进数据批量验证的错误信息返回

This commit is contained in:
thinkphp
2016-02-27 11:24:14 +08:00
parent 124697a1cc
commit 2ba3c7cfa7

View File

@@ -1031,7 +1031,11 @@ class Model
// 没有返回true 则表示验证失败
if (!empty($options['patch'])) {
// 批量验证
$this->error[] = $result;
if (is_array($result)) {
$this->error[] = $result;
} else {
$this->error[$key] = $result;
}
} else {
$this->error = $result;
return;