From d0ee97b142663f84c140e15f561e7a2fa7aa7f1c Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Wed, 11 Sep 2024 08:00:56 +0000 Subject: [PATCH] * [story#66942] mv getTableList to bi. --- module/bi/model.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/module/bi/model.php b/module/bi/model.php index 89db673948..4392f1f7aa 100644 --- a/module/bi/model.php +++ b/module/bi/model.php @@ -1602,6 +1602,37 @@ class biModel extends model return $stateObj; } + /** + * Get table list. + * + * @access public + * @return array + */ + public function getTableList() + { + $originTableTreeMenu = $this->loadModel('dataview')->getOriginTreeMenu(); + + $tableList = array(); + foreach($originTableTreeMenu as $index => $menu) + { + if(empty($menu->items)) continue; + + foreach($menu->items as $itemIndex => $item) + { + if(!is_array($item)) + { + $text = $item->key == 'story' ? $this->lang->pivot->story : $item->text; + $tableList[$item->key] = $text; + continue; + } + + foreach($item->items as $subIndex => $subItem) $tableList[$subItem->key] = $subItem->text; + } + } + + return $tableList; + } + /** * Build table columns from query result. *