diff --git a/module/bi/model.php b/module/bi/model.php index f99eea90cd..7cac006c1a 100644 --- a/module/bi/model.php +++ b/module/bi/model.php @@ -69,6 +69,25 @@ class biModel extends model } } } + + if($statement->join) + { + foreach($statement->join as $joinInfo) + { + if($joinInfo->expr->table) + { + $tables[] = $joinInfo->expr->table; + } + elseif($deep && $joinInfo->expr->subquery) + { + $parser = new sqlparser($joinInfo->expr->expr); + $subTables = $this->getTables($parser->statements[0], true); + $tables = array_merge($tables, $subTables); + } + } + } + + return array_filter(array_unique($tables)); } /**