fix sql error
This commit is contained in:
parent
a03634d816
commit
5fef38b8ab
|
@ -3253,7 +3253,8 @@ class Admin_DataController extends Zend_Controller_Action
|
||||||
//查看所有的未提交数据列表
|
//查看所有的未提交数据列表
|
||||||
else if((empty($ac) && empty($uuid))|| $ac=='list')
|
else if((empty($ac) && empty($uuid))|| $ac=='list')
|
||||||
{
|
{
|
||||||
$sql = "SELECT (regexp_matches(gn.data,'<resTitle>(.*)</resTitle>'))[1] as title,gn.id,gn.uuid,u.username,u.realname FROM en.geonetworkmetadata gn left join users u on gn.owner=u.id
|
$sql = "SELECT (regexp_matches(gn.data,'<resTitle>(.*)</resTitle>'))[1] as title,gn.id,gn.uuid,u.username,u.realname,t.count as version_count FROM en.geonetworkmetadata gn left join users u on gn.owner=u.id
|
||||||
|
left join (select count(*),uuid from en.mdversion group by uuid) t on t.uuid=gn.uuid
|
||||||
WHERE gn.uuid not in (select uuid from en.metadata)
|
WHERE gn.uuid not in (select uuid from en.metadata)
|
||||||
order by gn.id desc
|
order by gn.id desc
|
||||||
";
|
";
|
||||||
|
|
|
@ -2374,8 +2374,8 @@ class AuthorController extends Zend_Controller_Action
|
||||||
// 保存数据作者信息
|
// 保存数据作者信息
|
||||||
// 仅保存不存在的作者信息
|
// 仅保存不存在的作者信息
|
||||||
$sql="insert into mdauthor (uuid,userid,ts_activated,status) select ?,?,now(),1 where not exists
|
$sql="insert into mdauthor (uuid,userid,ts_activated,status) select ?,?,now(),1 where not exists
|
||||||
(select * from mdauthor where uuid=? and userid=?)";
|
(select id from mdauthor where uuid=? and userid=?)";
|
||||||
$this->db->query($sql,array($row['uuid'],$u_id),$row['uuid'],$u_id));
|
$this->db->query($sql,array($row['uuid'],$u_id),$row['uuid'],$u_id);
|
||||||
|
|
||||||
// 2. 保存变化记录 save changelog & userid for the latest version
|
// 2. 保存变化记录 save changelog & userid for the latest version
|
||||||
$sql = "UPDATE en.mdversion SET changelog=?,userid=? WHERE id in (select id from en.mdversion where uuid=? order by ts_created desc limit 1)";
|
$sql = "UPDATE en.mdversion SET changelog=?,userid=? WHERE id in (select id from en.mdversion where uuid=? order by ts_created desc limit 1)";
|
||||||
|
|
Loading…
Reference in New Issue