From 1ea9fbccc0b4bee73e48a6728929783c8964fdf4 Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 10 May 2012 13:10:22 +0000 Subject: [PATCH] =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E4=BA=86=E5=A7=94=E6=89=98?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=BA6=EF=BC=8C=E5=B9=B6=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BF=AE=E6=94=B9userid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/AuthorController.php | 14 +++++++------- .../default/views/scripts/author/accept.phtml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) 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 | 新闻 | 所有作者 - + | 委托 | 取消委托