修正Model类

This commit is contained in:
thinkphp
2016-05-08 22:42:43 +08:00
parent 6136572b6e
commit 6e9a18955b

View File

@@ -598,7 +598,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
protected static function parseQuery(&$data, $with, $cache)
{
$result = self::with($with)->cache($cache);
if (is_array($data)) {
if (is_array($data) && key($data) !== 0) {
$result = $result->where($data);
$data = [];
} elseif ($data instanceof \Closure) {