更新时间:2022-12-12 13:23:08
您需要使用 比较 验证器而不是唯一的.
You need to use compare validator instead of unique.
['new_password', 'compare', 'compareAttribute' => 'old_password', 'operator' => '!='],
因为唯一验证器验证属性值在整个表中是唯一的
Because unique validator validates that the attribute value is unique across the table