后台数据下载记录的分平台限制

This commit is contained in:
wlx 2014-06-11 07:35:28 +00:00
parent bb5a48cd6d
commit e24d2472b6
2 changed files with 25 additions and 25 deletions

View File

@ -88,7 +88,7 @@ class Admin_DownController extends Zend_Controller_Action
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$mail->addTo($row['email']);
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->send();
//如果是wsn数据则生成数据
@ -126,12 +126,12 @@ class Admin_DownController extends Zend_Controller_Action
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,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$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,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
$mail->send();
$data="";
@ -150,12 +150,12 @@ class Admin_DownController extends Zend_Controller_Action
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,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$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,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
$mail->send();
}
@ -179,11 +179,11 @@ class Admin_DownController extends Zend_Controller_Action
unset($mail);
$mail = new WestdcMailer($this->view->config->smtp);
$mailtp=new EmailText($this->db,'offline-start-author',array('user'=>$username,'datalist'=>$data));
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$mail->addTo($tmp_email);
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
$mail->send();
$data="";
@ -203,11 +203,11 @@ class Admin_DownController extends Zend_Controller_Action
unset($mail);
$mail = new WestdcMailer($this->view->config->smtp);
$mailtp=new EmailText($this->db,'offline-start-author',array('user'=>$username,'datalist'=>$data));
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$mail->addTo($tmp_email);
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
$mail->send();
}
@ -231,7 +231,7 @@ class Admin_DownController extends Zend_Controller_Action
unset($mail);
$mail = new WestdcMailer($this->view->config->smtp);
$mailtp=new EmailText($this->db,'offline-start-dcadmin',array('user'=>$username,'datalist'=>$data));
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$addrs=array();
@ -239,7 +239,7 @@ class Admin_DownController extends Zend_Controller_Action
$addrs[] = 'wangliangxu@lzb.ac.cn';
$addrs[] = 'wulizong@lzb.ac.cn';
$mail->addTo($addrs);
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
$mail->send();
}
@ -361,11 +361,11 @@ class Admin_DownController extends Zend_Controller_Action
unset($mail);
$mail = new WestdcMailer($this->view->config->smtp);
$mailtp=new EmailText($this->db,'offline-start-mdadmin',array('user'=>$username,'datalist'=>$data));
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$mail->addTo($tmp_email);
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
$mail->send();
$data='';
@ -382,11 +382,11 @@ class Admin_DownController extends Zend_Controller_Action
unset($mail);
$mail = new WestdcMailer($this->view->config->smtp);
$mailtp=new EmailText($this->db,'offline-start-mdadmin',array('user'=>$username,'datalist'=>$data));
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->setBodyText($mailtp->getBody());
$mail->setSubject($mailtp->getSubject());
$mail->addTo($tmp_email);
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->createAttachment($filecontent,'application/octet-stream',Zend_Mime::DISPOSITION_ATTACHMENT, Zend_Mime::ENCODING_BASE64, 'offlineapp.pdf');
$mail->send();
}
@ -523,9 +523,9 @@ class Admin_DownController extends Zend_Controller_Action
array('user'=>$row['username'],'datalist'=>str_replace(";","\n",$row['datalist']),
'ftpuser'=>$user->username,'ftppwd'=>$proftp->pwd,'ftptime'=>$proftp->time,'ftphost'=>$ftphost));
$mail->setBodyText($mailtp->getBody());
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->addTo($row['email']);
$mail->addCc($this->view->config->service->email,'西部数据中心服务组');
$mail->addCc($this->view->config->service->email,'数据服务组');
$mail->setSubject($mailtp->getSubject());
$mail->send();
} //offline deal
@ -1025,6 +1025,7 @@ class Admin_DownController extends Zend_Controller_Action
{
$show=(int)$this->_getParam('show');
$delete=(int)$this->_getParam('delete');
$submd=$this->view->config->sub->metadata;
if(empty($show) && empty($delete))
{
@ -1137,13 +1138,14 @@ class Admin_DownController extends Zend_Controller_Action
$show = $this->_getParam('show');
$search = $this->_getParam('search');
$keyword = $this->view->keyword = $this->_getParam('keyword');
$submd=$this->view->config->sub->metadata;
if(empty($show))
{
$select=$this->db->select();
$select->from('dataorder as o','count(o.id) as num')
->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->where('o.uuid = m.uuid and (o.status=0 or o.status=5)');
->join($submd.' as m', 'o.uuid = m.uuid', array('title','uuid'))
->where('o.uuid = m.uuid and (o.status=0 or o.status=5)')
if(!empty($search) && !empty($keyword))
{
$select ->Where('m.title like ? or m.title_en like ?','%'.$keyword.'%');
@ -1168,7 +1170,7 @@ class Admin_DownController extends Zend_Controller_Action
{
$select=$this->db->select();
$select->from('dataorder as o',array('ts_created','ts_created','offlineappid','onlineappid'))
->join('metadata as m', 'o.uuid = m.uuid', array('title','uuid'))
->join($submd.' as m', 'o.uuid = m.uuid', array('title','uuid'))
->join('users as u', 'o.userid=u.id',array('id as userid','username','realname'))
->where('m.uuid = ? and (o.status=0 or o.status=5)', $show)
->order('o.id desc');
@ -1179,7 +1181,7 @@ class Admin_DownController extends Zend_Controller_Action
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
$this->view->paginator=$paginator;
$sql="select title,uuid from metadata where uuid='$show'";
$sql="select title,uuid from $submd where uuid='$show'";
$re=$this->db->query($sql);
$t=$re->fetch();
$this->view->infos=$t;
@ -1257,7 +1259,7 @@ class Admin_DownController extends Zend_Controller_Action
foreach($mails as $k=>$v)
{
$mail=new WestdcMailer($this->view->config->smtp);
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->setFrom($this->view->config->service->email,'数据服务组');
$mail->setBodyText($body);
$mail->setSubject($title);
$mail->addTo($v['email']);

View File

@ -34,9 +34,7 @@ table thead tr th {background:#EBF2F6;color:#444;}
<div class="pull-left">
<a href="/admin/down/offline/add/1" class="btn btn-info">添加新的离线服务记录</a>
<a href="/admin/down/offline/down/1" class="btn btn-info">下载所有离线服务记录</a>
<a href="/admin/down/offline/update/1" class="btn btn-info" onclick="return confirm('该操作需要较长时间,请不要中途刷新页面,是否确定继续?')">自动匹配离线下载用户与网站用户</a>
<a href="/admin/down/offline/emaillist/1" class="btn btn-info">下载服务用户邮箱列表</a>
<a href="/admin/down/offline/monthreport/1" class="btn btn-info">下载上月服务记录(科技部上报)</a>
</div>
<div class="input-append pull-right">
<form id="datasearch" class="search_form" action="">