diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 3606766a..5b2067c1 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -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); }