|
|
@ -2015,12 +2015,12 @@ class DownloadController extends BaseController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function export() { //开始导出
|
|
|
|
public function export() { //开始导出
|
|
|
|
$id = $_REQUEST['lid'];
|
|
|
|
$id = $_REQUEST['lid'];
|
|
|
|
$dataname = $_REQUEST['dname'];
|
|
|
|
$downloadStatus = M('downloadlog','tab_')->where(['id'=>$id])->field('dataname,status,conditions')->select();
|
|
|
|
$downloadStatus = M('downloadlog','tab_')->where(['id'=>$id])->field('status')->select();
|
|
|
|
|
|
|
|
if($downloadStatus[0]['status'] == 1) {
|
|
|
|
if($downloadStatus[0]['status'] == 1) {
|
|
|
|
$this->error("该数据已下载请重新添加",U('listsIndex'));
|
|
|
|
$this->error("该数据已下载请重新添加",U('listsIndex'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$conditions = $_REQUEST['conditions'];
|
|
|
|
$dataname = $downloadStatus[0]['dataname'];
|
|
|
|
|
|
|
|
$conditions = $downloadStatus[0]['conditions'];
|
|
|
|
$map = array();
|
|
|
|
$map = array();
|
|
|
|
foreach (json_decode($conditions,FALSE) as $key => $value) {
|
|
|
|
foreach (json_decode($conditions,FALSE) as $key => $value) {
|
|
|
|
if($value !== 0 && $value !== "" ) {
|
|
|
|
if($value !== 0 && $value !== "" ) {
|
|
|
@ -2351,7 +2351,7 @@ class DownloadController extends BaseController {
|
|
|
|
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
|
|
|
|
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
|
|
|
|
$accessNum = '100000';//从数据库获取总量,假设是十万
|
|
|
|
$accessNum = '100000';//从数据库获取总量,假设是十万
|
|
|
|
$accessNum = count($data1)?:0 ;
|
|
|
|
$accessNum = count($data1)?:0 ;
|
|
|
|
|
|
|
|
var_dump($data1);die();
|
|
|
|
$perSize = 5000;//每次查询的条数
|
|
|
|
$perSize = 5000;//每次查询的条数
|
|
|
|
$pages = ceil($accessNum / $perSize);
|
|
|
|
$pages = ceil($accessNum / $perSize);
|
|
|
|
for($i = 1; $i <= $pages; $i++) {
|
|
|
|
for($i = 1; $i <= $pages; $i++) {
|
|
|
|