确认添加初始版本应为最早的版本;若已有版本发布则不添加对应的初始版本

This commit is contained in:
wlx 2012-06-11 10:44:42 +00:00
parent 6fcd27682e
commit d6cfe5e054
1 changed files with 2 additions and 2 deletions

View File

@ -3078,8 +3078,8 @@ class AuthorController extends Zend_Controller_Action
$sql="insert into mdversion (xml,ts_created,uuid,changelog,userid) $sql="insert into mdversion (xml,ts_created,uuid,changelog,userid)
select x.data,m.ts_created,?,?,? from metadata m left join xml x on m.id=x.id select x.data,m.ts_created,?,?,? from metadata m left join xml x on m.id=x.id
left join mdversion v on m.uuid=v.uuid left join mdversion v on m.uuid=v.uuid
where m.uuid=? and v.changelog is null where m.uuid=? and v.changelog is null and m.uuid not in (select uuid from mdversion where changelog is not null)
order by v.ts_created DESC LIMIT 1"; order by v.ts_created ASC LIMIT 1";
$sth=$this->db->prepare($sql); $sth=$this->db->prepare($sql);
try try
{ {