添加地图可视化管理

This commit is contained in:
Li Jianxuan 2015-02-09 09:27:11 +00:00
parent c7e81e1dab
commit b11bbdeae1
3 changed files with 62 additions and 0 deletions

View File

@ -4330,6 +4330,15 @@ class Admin_DataController extends Zend_Controller_Action
return true;
}//dataimportAction()
/**
* 地图可视化
*/
public function mapAction()
{
$map = new Visual\Map;
view::addPaginator($map->fetchAll(),$this,10);
}//mapAction()
public function doiAction()
{

View File

@ -13,5 +13,6 @@
<li><a href="/admin/data/doi">DOI注册</a></li>
<li><a href="/admin/data/visual">数据可视化</a></li>
<li><a href="/admin/data/dataimport">数据导入</a></li>
<li><a href="/admin/data/map">地图可视化</a></li>
</ul>
</div>

View File

@ -0,0 +1,52 @@
<?php
/**
* Created by PhpStorm.
* User: liujin834
* Date: 15-2-9
* Time: 下午5:01
*/
namespace Westdc\Visual;
class Map {
private $db;
private $config;
private $metadataTable;
function __construct()
{
$this->db = \Zend_Registry::get('db');
$this->config = \Zend_Registry::get('config');
$this->mainTable = "datamap";
if(isset($this->config->sub->metadata) && !empty($this->config->sub->metadata))
{
$this->metadataTable = $this->config->sub->metadata;
}else{
$this->metadataTable = 'metadata';
}
}
public function fetchAll()
{
$sql = "SELECT * FROM {$this->metadataTable} md
LEFT JOIN {$this->mainTable} m ON m.uuid = md.uuid
WHERE m.uuid IS NOT NULL
order by m.ts_changed desc";
$rs = $this->db->query($sql);
return $rs->fetchAll(\PDO::FETCH_ASSOC);
}
public function delete($id)
{
$sql = "DELETE FROM {$this->mainTable} WHERE id=$id";
return $this->db->exec($sql);
}
}