From e824fd217c9cfa319080763802b9ebb45e985b8e Mon Sep 17 00:00:00 2001 From: wlx Date: Tue, 8 Nov 2011 15:03:55 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=8C=AE=E4=BF=A1=E6=81=AF=E4=B8=AD?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BD=9C=E8=80=85=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/DataController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 2a555c11..ebad7c55 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -594,15 +594,15 @@ class DataController extends Zend_Controller_Action $sql="select distinct(md.uuid),md.title from keyword kw left join metadata 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 kw.id<>? limit 10"; $this->view->related=$this->db->fetchAll($sql,array($id,$id)); //相关文献 - $sql="select * from knl_article where "; + $sql="select a.*,array_to_string(array(select author from knl_author t where t.item_id=a.item_id order by place asc),'; ') as author from knl_article a where ("; foreach($this->view->keys as $k) { if ($k->keytype=='theme') { - $sql.=" title like '%".$k->keyword."%' or "; + $sql.=" a.title like '%".$k->keyword."%' or "; } } - $sql.=" 1<>1 limit 10"; + $sql.=" 1<>1) order by a.ts_created desc limit 10"; $this->view->literature=$this->db->fetchAll($sql); //数据附件 $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);