From b11bbdeae13cecfb043cf19f2ad0ff3611578320 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 9 Feb 2015 09:27:11 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=9B=BE=E5=8F=AF?= =?UTF-8?q?=E8=A7=86=E5=8C=96=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/DataController.php | 9 ++++ .../admin/views/scripts/data/left.phtml | 1 + application/module/Westdc/Visual/Map.php | 52 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 application/module/Westdc/Visual/Map.php diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index a152161f..3a9bf35b 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -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() { diff --git a/application/admin/views/scripts/data/left.phtml b/application/admin/views/scripts/data/left.phtml index 77609938..87464817 100644 --- a/application/admin/views/scripts/data/left.phtml +++ b/application/admin/views/scripts/data/left.phtml @@ -13,5 +13,6 @@
  • DOI注册
  • 数据可视化
  • 数据导入
  • +
  • 地图可视化
  • \ No newline at end of file diff --git a/application/module/Westdc/Visual/Map.php b/application/module/Westdc/Visual/Map.php new file mode 100644 index 00000000..29ca1edc --- /dev/null +++ b/application/module/Westdc/Visual/Map.php @@ -0,0 +1,52 @@ +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); + } + + + +} \ No newline at end of file