args[0]; $field = $this->args[1]; $model = $modelClass::query()->where([ $field => $value ])->first(); if ($model) { $this->addError("值 '{$value}' 在字段 '{$field}' 中已存在,不满足唯一性要求"); return false; } return true; } }