From 43d1f26b1a5740bd7f226a61262a2880f7b43926 Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 23 Jan 2013 03:00:29 +0000 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=90=9C=E7=B4=A2=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E6=AC=A1=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/AuthorController.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 29a9b93d..838b0b72 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -1851,7 +1851,17 @@ class AuthorController extends Zend_Controller_Action $sth = $this->db->prepare($sql); $sth->execute(array($id)); $row = $sth->fetch(); - + + //update search document + $search=new Search(); + //create search view in xunsearch + //$sql="select m.uuid,m.title,m.description,x.data,array_to_string(ARRAY( SELECT keyword.keyword FROM keyword WHERE keyword.id = m.id), ', '::text) AS keyword from normalmetadata m left join xml x on m.id=x.id where m.uuid=?"; + $sql="select * from xunsearch where uuid=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($row['uuid'])); + $data = $sth->fetch(); + $search->update($data); + if (empty($row)) //无对应记录 { $sql="select m.id from metadata m left join mdversion v on m.uuid=v.uuid where v.id=?"; @@ -2146,15 +2156,7 @@ class AuthorController extends Zend_Controller_Action $this->jsonexit($data); return true; } - //update search document - $search=new Search(); - //create search view in xunsearch - //$sql="select m.uuid,m.title,m.description,x.data,array_to_string(ARRAY( SELECT keyword.keyword FROM keyword WHERE keyword.id = m.id), ', '::text) AS keyword from normalmetadata m left join xml x on m.id=x.id where m.uuid=?"; - $sql="select * from xunsearch where uuid=?"; - $sth = $this->db->prepare($sql); - $sth->execute(array($row['uuid'])); - $row = $sth->fetch(); - $search->update($row); + }catch(Exception $e) { $msg = "提交失败,请确认权限后重试"; if($this->debug>0)