修复后台元数据发布时的xml解析以及搜索构建问题: westdc/westdc-zf1#24
This commit is contained in:
parent
1f8e3aaeeb
commit
87f796e7e9
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue