mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-03 05:41:38 +08:00
改写Validate类和单元测试
This commit is contained in:
@@ -989,11 +989,12 @@ class Model
|
||||
protected function dataValidate(&$data)
|
||||
{
|
||||
if (!empty($this->options['validate'])) {
|
||||
if (!empty($this->rule)) {
|
||||
Validate::rule($this->rule);
|
||||
$validate = Loader::validate($this->name);
|
||||
if (is_array($this->options['validate'])) {
|
||||
$validate->rule($this->options['validate']);
|
||||
}
|
||||
if (!Validate::check($data, $this->options['validate'])) {
|
||||
$this->error = Validate::getError();
|
||||
if (!$validate->check($data)) {
|
||||
$this->error = $validate->getError();
|
||||
return false;
|
||||
}
|
||||
$this->options['validate'] = null;
|
||||
|
||||
Reference in New Issue
Block a user