改进model类

This commit is contained in:
thinkphp
2016-05-08 22:24:40 +08:00
parent cdfe0a5e96
commit 6136572b6e

View File

@@ -599,7 +599,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
{
$result = self::with($with)->cache($cache);
if (is_array($data)) {
$result = self::db()->where($data);
$result = $result->where($data);
$data = [];
} elseif ($data instanceof \Closure) {
call_user_func_array($data, [ & $result]);
$data = [];