fix: TableTree

This commit is contained in:
origami11@yandex.ru 2026-01-30 12:55:58 +03:00
parent bbc262a21d
commit 29048a7203

View file

@ -30,8 +30,9 @@ class TableTree {
$keys = Functions::key_unique_values($name, $table); $keys = Functions::key_unique_values($name, $table);
$data = []; $data = [];
foreach ($keys as $index) { foreach ($keys as $index) {
list($rows, $table) = Functions::partition (Functions::lcurry(['\ctiso\Functions', '__index'], $index, $name), $table); list($rows, $table) = Functions::partition(fn($row) => $row[$name] == $index, $table);
// $rows = array_filter ($table, lcurry('__index', intval($index), $name)); // list($rows, $table) = Functions::partition (Functions::lcurry(['\ctiso\Functions', '__index'], $index, $name), $table);
// $rows = array_filter ($table, lcurry('__index', intval($index), $name));
//$rows = array_filter ($table, create_function ('$x', 'return __index ('.intval($index).', \''.$name.'\', $x);')); //$rows = array_filter ($table, create_function ('$x', 'return __index ('.intval($index).', \''.$name.'\', $x);'));
$data[$index] = call_user_func ($fn, $name, $index, $rows, self::walk ($level, $rows, $fn)); $data[$index] = call_user_func ($fn, $name, $index, $rows, self::walk ($level, $rows, $fn));
} }