修复发布后的问题

This commit is contained in:
wlx 2014-06-23 06:56:40 +00:00
parent 237dc74989
commit 8102223a87
1 changed files with 10 additions and 10 deletions

View File

@ -276,7 +276,7 @@ class Review extends Zend_Controller_Plugin_Abstract
include_once("helper/view.php"); include_once("helper/view.php");
$userid = (int)view::User('id'); $userid = (int)view::User('id');
} }
$sql = "select id from mdstatus where id=$id and userid=$userid"; $sql = "select id from en.mdstatus where id=$id and userid=$userid";
$rs = $this->db->query($sql); $rs = $this->db->query($sql);
$row = $rs->fetch(); $row = $rs->fetch();
@ -368,22 +368,22 @@ class ReviewListener implements Zend_EventManager_ListenerAggregate
if(is_numeric($id)) if(is_numeric($id))
{ {
//发布正式版本 //发布正式版本
$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)"; $sql = "UPDATE en.mdversion SET changelog=?,userid=? WHERE id in (select id from en.mdversion where uuid in (select uuid from en.mdstatus where id=?) order by ts_created desc limit 1)";
$this->db->query($sql,array('发布第一个正式版本 version 1.0',$userid,$id)); $this->db->query($sql,array('Version 1.0 Released.',$userid,$id));
//删除所有的中间版本 //删除所有的中间版本
$sql="delete from mdversion where changelog is null and uuid in (select uuid from mdstatus where id=?)"; $sql="delete from en.mdversion where changelog is null and uuid in (select uuid from en.mdstatus where id=?)";
$this->db->query($sql,array($id)); $this->db->query($sql,array($id));
//email message //email message
if(isset($emails) &&is_array($emails) && count($emails)>0) if(isset($emails) &&is_array($emails) && count($emails)>0)
{ {
$config=Zend_Registry::get('config'); $config=Zend_Registry::get('config');
$mail=new WestdcMailer($config->smtp); $mail=new WestdcMailer($config->smtp);
$sql="select m.uuid,m.title from metadata m left join mdstatus s on m.uuid=s.uuid where s.id='$id'"; $sql="select m.uuid,m.title from en.metadata m left join en.mdstatus s on m.uuid=s.uuid where s.id='$id'";
$rs=$this->db->query($sql); $rs=$this->db->query($sql);
$res=$rs->fetch(); $res=$rs->fetch();
$mailtp=new EmailText($this->db,'metadata-publish',array('uuid'=>$res['uuid'],'title'=>$res['title'])); $mailtp=new EmailText($this->db,'metadata-publish-en',array('uuid'=>$res['uuid'],'title'=>$res['title']));
$mail->setBodyText($mailtp->getBody()); $mail->setBodyText($mailtp->getBody());
$mail->setFrom($config->service->email,'西部数据中心服务组'); $mail->setFrom($config->service->email,'CARD support group');
foreach($emails as $email) $mail->addTo($email); foreach($emails as $email) $mail->addTo($email);
$mail->setSubject($mailtp->getSubject()); $mail->setSubject($mailtp->getSubject());
$mail->send(); $mail->send();
@ -395,10 +395,10 @@ class ReviewListener implements Zend_EventManager_ListenerAggregate
foreach($id as $v) foreach($id as $v)
{ {
//发布正式版本 //发布正式版本
$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)"; $sql = "UPDATE en.mdversion SET changelog=?,userid=? WHERE id in (select id from en.mdversion where uuid in (select uuid from en.mdstatus where id=?) order by ts_created desc limit 1)";
$this->db->query($sql,array('发布第一个正式版本 version 1.0',$userid,$v)); $this->db->query($sql,array('Version 1.0 Released.',$userid,$v));
//删除所有的中间版本 //删除所有的中间版本
$sql="delete from mdversion where changelog is null and uuid in (select uuid from mdstatus where id=?)"; $sql="delete from en.mdversion where changelog is null and uuid in (select uuid from en.mdstatus where id=?)";
$this->db->query($sql,array($v)); $this->db->query($sql,array($v));
} }
} }