fix: tree child api

This commit is contained in:
daodao97
2021-05-18 17:49:55 +08:00
parent 4ccb7200eb
commit 839bd1e0b9

View File

@@ -390,7 +390,8 @@ abstract class AbstractController extends Controller
$order_by = $this->options['order_by'] ?? ''; $order_by = $this->options['order_by'] ?? '';
$attr['select'] = $columns; $attr['select'] = $columns;
$order_by && $attr['order_by'] = $order_by; $order_by && $attr['order_by'] = $order_by;
$childs = $this->getEntity()->list(['pid' => $id], $attr); $parent_key = $this->options['table']['tree']['pid'] ?? 'pid';
$childs = $this->getEntity()->list([$parent_key => $id], $attr);
foreach ($tableOptions as $item) { foreach ($tableOptions as $item) {
if (!isset($item['render'])) { if (!isset($item['render'])) {
continue; continue;