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

@ -2355,7 +2355,7 @@ class AuthorController extends Zend_Controller_Action
}
// 保存数据作者信息
$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