diff --git a/application/admin/controllers/DownController.php b/application/admin/controllers/DownController.php index 8668d5d4..da7b9616 100644 --- a/application/admin/controllers/DownController.php +++ b/application/admin/controllers/DownController.php @@ -63,58 +63,6 @@ class Admin_DownController extends Zend_Controller_Action //需要取出对应数据的标题、uuid,以及对应的作者的email(一条数据可能有多个作者,一次申请可能有多条数据对应同一个作者) //邮件中应提示用户可以选择是否委托给数据中心进行管理(这样以后就不接受相应的管理邮件,但用户仍然可以自主取消此选择) $uuid_done=""; - // 0. 处理专题数据集 - $sql="select s.admin_email as email,m.title,d.uuid,s.title as sourcetitle from dataorder d left join datasource ds on d.uuid=ds.uuid - left join source s on ds.sourceid=s.id left join metadata m on d.uuid=m.uuid - where d.offlineappid=? and s.admin_status=1 and d.uuid<>all(s.exclude_data) - order by s.admin_email,m.title"; - $rows=$this->db->fetchAll($this->db->quoteInto($sql,$start)); - $tmp_email=''; - $data=''; - $source=''; - foreach($rows as $row) - { - if ($tmp_email!=$row['email']) - { - if (!empty($data)) - { - //发送之前的用户申请审核邮件 - unset($mail); - $mail = new WestdcMailer($this->view->config->smtp); - $mailtp=new EmailText($this->db,'offline-start-subject',array('user'=>$username,'datalist'=>$data,'source'=>$source)); - $mail->setFrom($this->view->config->service->email,$this->view->config->service->poster); - $mail->setBodyText($mailtp->getBody()); - $mail->setSubject($mailtp->getSubject()); - $mail_addrs=explode(",",substr($tmp_email,1,-1)); - $mail->addTo($mail_addrs); - $mail->addCc($this->view->config->service->email,$this->view->config->service->poster); - $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf'); - $mail->send(); - $data=""; - $source=""; - } - $tmp_email=$row['email']; - $source=$row['sourcetitle']; - } - $data.=" 数据名称:".$row['title']."\n"; - $data.=" \t数据地址:http://deep.qherc.org/data/".$row['uuid']."\n\n"; - $uuid_done.="'".$row['uuid']."',"; - } - //发送最后一封邮件 - if (!empty($data)) - { - unset($mail); - $mail = new WestdcMailer($this->view->config->smtp); - $mailtp=new EmailText($this->db,'offline-start-author',array('user'=>$username,'datalist'=>$data,'source'=>$source)); - $mail->setFrom($this->view->config->service->email,$this->view->config->service->poster); - $mail->setBodyText($mailtp->getBody()); - $mail->setSubject($mailtp->getSubject()); - $mail_addrs=explode(",",substr($tmp_email,1,-1)); - $mail->addTo($mail_addrs); - $mail->addCc($this->view->config->service->email,$this->view->config->service->poster); - $mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf'); - $mail->send(); - } // 1. 处理有数据作者且自行管理的数据并且未被0处理过的 $sql="select u.email,m.title,d.uuid,a.activation from dataorder d left join mdstatus s on d.uuid=s.uuid left join users u on s.userid=u.id