getUrl($data, $col, $col[$rule[0]]), $rule[1])->get(); array_shift($rule); } else { $result = self::rule($doc, $data, $col, $col[$rule[0]]['collect_rule'], $key); } } else { if (is_string($data)) { $data = json_decode($data, true); } if (is_object($data)) { $result = Dom::find($data, $rule[0]); } elseif (is_array($data)) { $temp = explode('.', $rule[0]); $result = $data; foreach ($temp as $k => $v) { if (isset($result[$v])) { $result = $result[$v]; } } } } } /* if (isset($rule[0]) && $rule[0]) { if (isset($col[$rule[0]]) && $rule[0] != $key) { # 此处开task if (isset($rule[1]) && $rule[1]) { $result = Doc::getInstance($doc->getUrl($data, $col, $col[$rule[0]]), $rule[1])->get(); array_shift($rule); } else { $result = self::rule($doc, $data, $col, $col[$rule[0]]['collect_rule'], $key); } } elseif (isset($data[$rule[0]])) { $result = $data[$rule[0]]; } else { $result = Dom::find($data, $rule[0]); } } */ if (isset($rule[1]) && $rule[1]) $result = self::match($rule[1], $result); return $result; } }