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));