From f86001f75d566ab1c65a5949d3aee0d392cf0ef1 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 12 Jun 2014 01:51:59 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E5=8C=96=E6=97=B6=E5=85=83=E6=95=B0=E6=8D=AE=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/module/Westdc/Visual/Visual.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/application/module/Westdc/Visual/Visual.php b/application/module/Westdc/Visual/Visual.php index 0627fa5d..fe1c1404 100644 --- a/application/module/Westdc/Visual/Visual.php +++ b/application/module/Westdc/Visual/Visual.php @@ -6,17 +6,29 @@ use Helpers\dbh; class Visual { - public $db; + private $db; + private $config; + protected $events; + private $metadataTable; + function __construct() { $this->db = \Zend_Registry::get('db'); + $this->config = \Zend_Registry::get('config'); $this->mainTable = "datavisual"; $Listener = new Listener(); @$this->getEventManager()->attachAggregate($Listener); + + if(isset($this->config->sub->metadata) && !empty($this->config->sub->metadata)) + { + $this->metadataTable = $this->config->sub->metadata; + }else{ + $this->metadataTable = 'metadata'; + } } public function getEventManager(\Zend_EventManager_EventCollection $events = NULL) @@ -101,7 +113,7 @@ class Visual //获得可以可视化的元数据 public function getVisualMetadata() { - $sql = "SELECT * FROM metadata md + $sql = "SELECT * FROM {$this->metadataTable} md LEFT JOIN {$this->mainTable} v ON v.uuid = md.uuid WHERE v.uuid IS NOT NULL";