diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php index 9b20bc91..693cc567 100644 --- a/application/default/controllers/AuthorController.php +++ b/application/default/controllers/AuthorController.php @@ -2795,17 +2795,17 @@ class AuthorController extends Zend_Controller_Action $this->view->metadata = $row; //确认一下用户有权限,如果直接使用update语句无法得到已更改过的状态 - + //只要是认证后的数据作者,都可以修改数据的委托状态 $sql = "SELECT * FROM mdstatus - WHERE uuid=? AND userid=? AND (status=? OR status=?)"; + WHERE uuid=? AND userid in (select userid from mdauthor where status=1 and uuid=?) AND status=?"; $sth = $this->db->prepare($sql); - $sth->execute(array($uuid,$uid,5,6)); + $sth->execute(array($uuid,$uuid,6)); $mds = $sth->fetch(); if(!empty($mds['id'])) { - $sql = "UPDATE mdstatus SET status=7,ts_changed='now()' WHERE uuid='$uuid' AND userid=$uid"; + $sql = "UPDATE mdstatus SET status=7,ts_changed='now()',userid=$uid WHERE uuid='$uuid'"; if($this->db->exec($sql)) { $this->view->info = "委托成功!"; @@ -2845,15 +2845,15 @@ class AuthorController extends Zend_Controller_Action $this->view->metadata = $row; $sql = "SELECT * FROM mdstatus - WHERE uuid=? AND userid=? AND status=?"; + WHERE uuid=? AND userid in (select userid from mdauthor where status=1 and uuid=?) AND status=?"; $sth = $this->db->prepare($sql); - $sth->execute(array($uuid,$uid,7)); + $sth->execute(array($uuid,$uuid,7)); $mds = $sth->fetch(); if(!empty($mds['id'])) { - $sql = "UPDATE mdstatus SET status=6,ts_changed='now()' WHERE uuid='$uuid' AND userid=$uid"; + $sql = "UPDATE mdstatus SET status=6,ts_changed='now()',userid=$uid WHERE uuid='$uuid'"; if($this->db->exec($sql)) { $this->view->info = "取消委托成功!"; diff --git a/application/default/views/scripts/author/accept.phtml b/application/default/views/scripts/author/accept.phtml index de8cc1dc..49e0902a 100644 --- a/application/default/views/scripts/author/accept.phtml +++ b/application/default/views/scripts/author/accept.phtml @@ -44,7 +44,7 @@ $this->breadcrumb()->setSeparator(' > '); QA | 新闻 | 所有作者 - + | 委托 | 取消委托