改进Query类的find方法 支持查询主键为0的情况

This commit is contained in:
thinkphp
2016-05-03 18:20:33 +08:00
parent 289507c0ce
commit 0af5b072a9

View File

@@ -1294,7 +1294,7 @@ class Query
// 分析查询表达式
$options = $this->parseExpress();
if (empty($options['where']) && !empty($data)) {
if (empty($options['where']) && (!empty($data) || 0 == $data)) {
// AR模式分析主键条件
$this->parsePkWhere($data, $options);
}