Ticket #191 增加了导出用户email的功能。
This commit is contained in:
parent
e7233554de
commit
8cbe2bf913
|
@ -186,6 +186,7 @@ class Admin_DownController extends Zend_Controller_Action
|
||||||
$update=$this->_getParam('update');
|
$update=$this->_getParam('update');
|
||||||
$show=$this->_getParam('show');
|
$show=$this->_getParam('show');
|
||||||
$undelete=$this->_getParam('undelete');
|
$undelete=$this->_getParam('undelete');
|
||||||
|
$emaillist=$this->_getParam('emaillist');
|
||||||
|
|
||||||
if ($add) {
|
if ($add) {
|
||||||
$form=new OfflinelogForm();
|
$form=new OfflinelogForm();
|
||||||
|
@ -311,6 +312,40 @@ class Admin_DownController extends Zend_Controller_Action
|
||||||
$this->_helper->viewRenderer('offlineshow');
|
$this->_helper->viewRenderer('offlineshow');
|
||||||
|
|
||||||
}//查看单条记录
|
}//查看单条记录
|
||||||
|
else if($emaillist)
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = "select distinct(t.*) from
|
||||||
|
(
|
||||||
|
select u.email from dataorder d left join users u on d.userid=u.id where (d.status=0 or d.status=5)
|
||||||
|
union
|
||||||
|
select o.email from offlineapp o where o.userid is null and o.email is not null
|
||||||
|
) as t";
|
||||||
|
$re = $this->db->query($sql);
|
||||||
|
$rows = $re->fetchAll();
|
||||||
|
$filecontent = "";
|
||||||
|
foreach($rows as $row){
|
||||||
|
$filecontent.=$row['email']."\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->_helper->layout->disableLayout();
|
||||||
|
$this->_helper->viewRenderer->setNoRender();
|
||||||
|
$this->getResponse()->setHeader('Content-Type', 'application/octet-stream')
|
||||||
|
->setHeader('Content-Disposition','attachment; filename="emails.txt"')
|
||||||
|
->setHeader('Content-Length', strlen($filecontent))
|
||||||
|
->setHeader('Content-Type','application/force-download')
|
||||||
|
->setHeader('Content-Type','application/download')
|
||||||
|
->setHeader('Content-Description','File Transfer')
|
||||||
|
->setHeader('Content-Transfer-Encoding','binary')
|
||||||
|
->setHeader('Expires',0)
|
||||||
|
->setHeader('Cache-Control','must-revalidate, post-check=0, pre-check=0')
|
||||||
|
->setHeader('Pragma','public')
|
||||||
|
->setBody($filecontent);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}//下载邮箱地址列表
|
||||||
$select=$this->db->select();
|
$select=$this->db->select();
|
||||||
$select->from('offlineapp')->where('ts_approved is not null')->where('pdflink is not null')->order('ts_created desc');
|
$select->from('offlineapp')->where('ts_approved is not null')->where('pdflink is not null')->order('ts_created desc');
|
||||||
$paginator = Zend_Paginator::factory($select);
|
$paginator = Zend_Paginator::factory($select);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="right_title">离线数据服务记录</div>
|
<div class="right_title">离线数据服务记录</div>
|
||||||
<a href="/admin/down/offline/add/1">添加新的离线服务记录</a> | <a href="/admin/down/offline/down/1">下载所有离线服务记录</a> | <a href="/admin/down/offline/update/1" onclick="return confirm('该操作需要较长时间,请不要中途刷新页面,是否确定继续?')">自动匹配离线下载用户与网站用户</a>
|
<a href="/admin/down/offline/add/1">添加新的离线服务记录</a> | <a href="/admin/down/offline/down/1">下载所有离线服务记录</a> | <a href="/admin/down/offline/update/1" onclick="return confirm('该操作需要较长时间,请不要中途刷新页面,是否确定继续?')">自动匹配离线下载用户与网站用户</a> | <a href="/admin/down/offline/emaillist/1">下载服务用户邮箱列表</a>
|
||||||
<?php if (count($this->paginator)): ?>
|
<?php if (count($this->paginator)): ?>
|
||||||
<table>
|
<table>
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
|
|
Loading…
Reference in New Issue