From 0472e2fd26c9b1d023b3b533a295249541e422b5 Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 30 Jun 2010 09:58:12 +0000 Subject: [PATCH] =?UTF-8?q?widas=E5=A2=9E=E5=8A=A0=E8=88=AA=E7=A9=BA?= =?UTF-8?q?=E9=81=A5=E6=84=9F=E5=85=B3=E9=94=AE=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/WaterController.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/application/default/controllers/WaterController.php b/application/default/controllers/WaterController.php index fcb7c017..d4acbf44 100644 --- a/application/default/controllers/WaterController.php +++ b/application/default/controllers/WaterController.php @@ -130,13 +130,23 @@ class WaterController extends DataController { $this->getmd('微波辐射计','theme'); } - function lidarAction() + function lidarAction() { $this->getmd('激光雷达','theme'); } function widasAction() { - $this->getmd('WiDAS','theme'); + //$this->getmd('WiDAS','theme'); + $page=(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $state=$this->db->query("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='WiDAS') and id in (select id from keyword where keytype='theme' and keyword='航空遥感')"); + $row=$state->fetchAll(); + $sum=$row[0]['count']; + $sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='WiDAS') and id in (select id from keyword where keytype='theme' and keyword='航空遥感') order by timebegin limit ? offset ?"; + $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); + $this->view->page=new Pagination($sum,$page,$this->limit); + $this->view->offset=$offset+1; } function asdAction() { @@ -250,6 +260,7 @@ class WaterController extends DataController $state=$this->db->query("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='".$type."' and keyword='".$keyword."')"); $row=$state->fetchAll(); $sum=$row[0]['count']; + //@todo: add order with title $sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='".$type."' and keyword='".$keyword."') order by timebegin limit ? offset ?"; $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); $this->view->page=new Pagination($sum,$page,$this->limit);