fixed bug in sql

This commit is contained in:
JianxuanLi 2016-09-21 16:12:02 +08:00
parent d5218d17d6
commit 122dcc74aa
1 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class AuthorController extends Zend_Controller_Action
// 调试模式中将显示全部错误细节,电子邮件将发往调试邮箱 // 调试模式中将显示全部错误细节,电子邮件将发往调试邮箱
// 1 为开启 // 1 为开启
// 0 为关闭 // 0 为关闭
public $debug = 0; public $debug = 0;
//调试模式邮箱地址 //调试模式邮箱地址
public $debug_email = "wangliangxu@lzb.ac.cn"; public $debug_email = "wangliangxu@lzb.ac.cn";
@ -2352,12 +2352,12 @@ class AuthorController extends Zend_Controller_Action
$data=array("error"=>"元数据导入过程中发现错误。<br />".implode("<br />",$iso->error)); $data=array("error"=>"元数据导入过程中发现错误。<br />".implode("<br />",$iso->error));
$this->jsonexit($data); $this->jsonexit($data);
return true; return true;
} }
// 保存数据作者信息 // 保存数据作者信息
$sql="insert into mdauthor (uuid,userid,ts_activated,status) values(?,?,now(),1) where not exists (select id from mdauthor where uuid=? and userid=?)"; $sql="insert into mdauthor (uuid,userid,ts_activated,status) SELECT ?,?,now(),1 where not exists (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 mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid=? order by ts_created desc limit 1)"; $sql = "UPDATE mdversion SET changelog=?,userid=? WHERE id in (select id from mdversion where uuid=? order by ts_created desc limit 1)";
$this->db->query($sql,array($changelog,$u_id,$row['uuid'])); $this->db->query($sql,array($changelog,$u_id,$row['uuid']));