From 72c8622ed758da2a262435d46ae22c7fc10d1237 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 24 Nov 2011 07:45:55 +0000 Subject: [PATCH] =?UTF-8?q?heihe=20view=E4=B8=AD=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=85=83=E6=95=B0=E6=8D=AE=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/DataController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 3e73a336..e7affe15 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -599,7 +599,10 @@ class DataController extends Zend_Controller_Action } } $sql.=" 1<>1) order by a.ts_created desc limit 10"; - $this->view->literature=$this->db->fetchAll($sql); + $this->view->literature=$this->db->fetchAll($sql); + //相关元数据,根据同名关键词实现 + $sql="select distinct(md.uuid),md.title from keyword kw left join normalmetadata md on kw.id=md.id where kw.keyword in (select k.keyword from keyword k left join metadata m on k.id=m.id where m.id=? and k.keytype='theme') and kw.id<>? limit 10"; + $this->view->related=$this->db->fetchAll($sql,array($id,$id)); //数据附件 $sql = $this->db->quoteInto("select m.id,a.realname from mdattach m left join attachments a on m.id=a.id where m.uuid=?",$uuid); $this->view->attachments = $this->db->fetchAll($sql);