From 4a95ae4d8a727e92fa92b3400dde59857c5c4dd5 Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 21 May 2012 11:34:20 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E5=8D=95=E6=9D=A1=E5=B7=B2=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E6=95=B0=E6=8D=AE=E5=8F=91=E9=80=81email?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/ReviewController.php | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/application/admin/controllers/ReviewController.php b/application/admin/controllers/ReviewController.php index 4da9d676..387e93d5 100644 --- a/application/admin/controllers/ReviewController.php +++ b/application/admin/controllers/ReviewController.php @@ -743,7 +743,38 @@ class Admin_ReviewController extends Zend_Controller_Action else $ids=$update; if($this->changestatus($ids,1)) - { + { + //仅对单条数据发送email信息,并且注册为数据作者 + if (is_numeric($ids)) + { + $sql="select distinct u.email,m.title,m.uuid from mdstatus s left join metadata m on s.uuid=m.uuid + left join mdauthor a on s.uuid=a.uuid left join users u on a.userid=u.id where s.id=? order by u.email"; + $rs=$this->db->query($sql,array($ids)); + $rows=$rs->fetchAll($rs); + if ($rows) + { + //有数据作者 + $mail=array(); + foreach ($rows as $row) + { + $mail[]=$row['email']; + } + $title=$rows[0]['title']; + $uuid=$rows[0]['uuid']; + //send email + $mail=new WestdcMailer($this->view->config->smtp); + $mail->setFrom($this->view->config->service->email,'西部数据中心服务组'); + $mailtp=new EmailText($this->db,"review-new-accept",array( + 'uuid' => $iso->uuid, + 'title'=> $iso->resTitle + )); + $mail->setBodyText($mailtp->getBody()); + $mail->setSubject($mailtp->getSubject()); + $mail->addTo($mail); + $mail->addCC($this->view->config->service->email); + $mail->send(); + } + } $this->messenger->addMessage('操作成功!'); $this->_redirect("/admin/review/draft"); } @@ -764,7 +795,7 @@ class Admin_ReviewController extends Zend_Controller_Action $sql = "select m.id,md.title,md.uuid,u.username,u.realname,m.status,m.ts_created from mdstatus m right join metadata md on md.uuid=m.uuid left join users u on u.id=m.userid - where status=0 $searchjoin"; + where status=0 $searchjoin order by m.ts_created desc"; $re = $this->db->query($sql); $rows = $re->fetchAll();