From 122dcc74aaab43d37419696bb1efc9fd65fae95b Mon Sep 17 00:00:00 2001 From: JianxuanLi Date: Wed, 21 Sep 2016 16:12:02 +0800 Subject: [PATCH] fixed bug in sql --- application/default/controllers/AuthorController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index c0c805b0..be29d448 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -17,7 +17,7 @@ class AuthorController extends Zend_Controller_Action // 调试模式中将显示全部错误细节,电子邮件将发往调试邮箱 // 1 为开启 // 0 为关闭 - public $debug = 0; + public $debug = 0; //调试模式邮箱地址 public $debug_email = "wangliangxu@lzb.ac.cn"; @@ -2352,12 +2352,12 @@ class AuthorController extends Zend_Controller_Action $data=array("error"=>"元数据导入过程中发现错误。
".implode("
",$iso->error)); $this->jsonexit($data); 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)); - + // 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)"; $this->db->query($sql,array($changelog,$u_id,$row['uuid']));