From 733a844b3a95a0830788f672b8c2517028cc5c3e Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 13 Jun 2013 12:39:15 +0000 Subject: [PATCH] add list action --- .../default/controllers/DataController.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 775538f5..4a7a8d54 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -2041,5 +2041,30 @@ class DataController extends Zend_Controller_Action } } + function listAction() + { + $sql="select m.uuid,m.title,m.citation,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year from normalmetadata m +left join mdstatus s on m.uuid=s.uuid +left join datadoi d on d.uuid=m.uuid +where s.status>4 +and m.uuid not in +(select d.uuid from datasource d left join source s on d.sourceid=s.id +where s.code in ('heihe','water','hiwater','westee')) +order by m.title"; + $this->view->metadata=$this->db->fetchAll($sql); + $sql="select m.uuid,m.title,m.citation,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year + from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid where s.status>4 and m.title like '黑河综合遥感联合试验%' order by title"; + $this->view->water=$this->db->fetchAll($sql); + $sql="select m.uuid,m.title,m.citation ,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year + from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid where s.status>0 and m.title like '黑河生态水文遥感试验%' order by title"; + $this->view->hiwater=$this->db->fetchAll($sql); + $sql="select m.uuid,m.title,m.citation ,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year + from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid left join datasource ds on ds.uuid=m.uuid left join source sr on ds.sourceid=sr.id where sr.code='heihe' and s.status>0 and m.title not like '黑河生态水文遥感试验%' order by title"; + $this->view->heihe=$this->db->fetchAll($sql); + $sql="select m.uuid,m.title,m.citation ,m.doi,d.doi as datadoi,d.ts_published,d.authors,d.publisher,date_part('year',d.ts_published) as publish_year + from normalmetadata m left join datadoi d on d.uuid=m.uuid left join mdstatus s on m.uuid=s.uuid left join datasource ds on ds.uuid=m.uuid left join source sr on ds.sourceid=sr.id where sr.code='westee' and s.status>4 order by title"; + $this->view->westee=$this->db->fetchAll($sql); + + } }