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. *