think\Model::parseQuery PHP Method

parseQuery() protected static method

分析查询表达式
protected static parseQuery ( mixed &$data, string $with, boolean $cache ) : Query
$data mixed 主键列表或者查询条件(闭包)
$with string 关联预查询
$cache boolean 是否缓存
return Think\Db\Query
    protected static function parseQuery(&$data, $with, $cache)
    {
        $result = self::with($with)->cache($cache);
        if (is_array($data) && key($data) !== 0) {
            $result = $result->where($data);
            $data = null;
        } elseif ($data instanceof \Closure) {
            call_user_func_array($data, [&$result]);
            $data = null;
        } elseif ($data instanceof Query) {
            $result = $data->with($with)->cache($cache);
            $data = null;
        }
        return $result;
    }