优化unique方法的查询

This commit is contained in:
thinkphp
2016-03-20 23:20:15 +08:00
parent 7d0e423ffd
commit 60578e5b8d

View File

@@ -561,7 +561,7 @@ class Validate
if (isset($except)) { if (isset($except)) {
$map[$key] = ['neq', $except]; $map[$key] = ['neq', $except];
} }
if ($model->where($map)->find()) { if ($model->where($map)->field($key)->find()) {
return false; return false;
} }
return true; return true;