From ec361d42b19beb1711dcc59dc4aa266e93bfdf2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Wed, 19 Jun 2024 13:50:46 +0800 Subject: [PATCH] + [misc] add another part of getTables. --- module/bi/model.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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)); } /**