From c74735ec7e269655aac8c6bccd7cb381c8d1e19d Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 21 Dec 2015 23:38:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8F=91=E5=B8=83=E6=97=B6=E7=9A=84xml?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E4=BB=A5=E5=8F=8A=E6=90=9C=E7=B4=A2=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E9=97=AE=E9=A2=98:=20westdc/westdc-zf1#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/data/Review.php | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/application/models/data/Review.php b/application/models/data/Review.php index 16b8ec6f..bd1e5e56 100644 --- a/application/models/data/Review.php +++ b/application/models/data/Review.php @@ -367,6 +367,23 @@ class ReviewListener implements Zend_EventManager_ListenerAggregate if(is_numeric($id)) { + //同步元数据 + $sql = "select v.xml,m.uuid from mdversion v left join metadata m on m.uuid=v.uuid left join mdstatus ms on ms.uuid=m.uuid where ms.id=? order by v.ts_created desc limit 1"; + $sth = $this->db->prepare($sql); + $sth->execute(array($id)); + $row=$sth->fetch(); + + $iso=new ISO19115(); + $iso->saveDB($this->db,$row['xml']); + + //构建搜索 + $sql="select * from xunsearch where uuid=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($row['uuid'])); + $data_search = $sth->fetch(); + $search=new Search(); + $search->update($data_search); + //发布正式版本 $sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid in (select uuid from mdstatus where id=?) order by ts_created desc limit 1)"; $this->db->query($sql,array('发布第一个正式版本 version 1.0',$userid,$id)); @@ -394,6 +411,23 @@ class ReviewListener implements Zend_EventManager_ListenerAggregate { foreach($id as $v) { + //同步元数据 + $sql = "select v.xml,m.uuid from mdversion v left join metadata m on m.uuid=v.uuid left join mdstatus ms on ms.uuid=m.uuid where ms.id=? order by v.ts_created desc limit 1"; + $sth = $this->db->prepare($sql); + $sth->execute(array($v)); + $row=$sth->fetch(); + + $iso=new ISO19115(); + $iso->saveDB($this->db,$row['xml']); + + //构建搜索 + $sql="select * from xunsearch where uuid=?"; + $sth = $this->db->prepare($sql); + $sth->execute(array($row['uuid'])); + $data_search = $sth->fetch(); + $search=new Search(); + $search->update($data_search); + //发布正式版本 $sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid in (select uuid from mdstatus where id=?) order by ts_created desc limit 1)"; $this->db->query($sql,array('发布第一个正式版本 version 1.0',$userid,$v));