This commit is contained in:
2021-03-08 16:25:01 +08:00
parent 7b13890bb7
commit 18138fc2bf
+2
View File
@@ -394,6 +394,7 @@ class Node extends HttpService
*/ */
public function addChild(Node $node, string $field): Node public function addChild(Node $node, string $field): Node
{ {
$field = 'node_' . $field;
/** @var Node $oLod */ /** @var Node $oLod */
$oLod = $this->childes[$field] ?? null; $oLod = $this->childes[$field] ?? null;
if (!empty($oLod)) { if (!empty($oLod)) {
@@ -440,6 +441,7 @@ class Node extends HttpService
$_searchMatch = '/<(\w+)?:(.+)?>/'; $_searchMatch = '/<(\w+)?:(.+)?>/';
foreach ($this->childes as $key => $val) { foreach ($this->childes as $key => $val) {
$key = 'node_' . $key;
if (preg_match($_searchMatch, $key, $match)) { if (preg_match($_searchMatch, $key, $match)) {
Input()->addGetParam($match[1] ?? '--', $search); Input()->addGetParam($match[1] ?? '--', $search);
return $this->childes[$key]; return $this->childes[$key];