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";