修改数据可视化时元数据读取来源
This commit is contained in:
parent
5791184f19
commit
f86001f75d
|
@ -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";
|
||||
|
||||
|
|
Loading…
Reference in New Issue