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();