From 629c733742c836f4ddb615d70e3c36de86f6bb5a Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 23 Dec 2019 11:18:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=87=BD=E6=95=B0=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 72a4e5687..3b1d39e51 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1713,29 +1713,6 @@ function getOffspringByPromoteId($promote_id) { ->find(); return $promote_ids['promote_ids']; } - - -//导出csv 2019/12/20 -function db2csv(&$data,$title,$header=false){ - set_time_limit(0); - $filename = $title .'.csv'; - $fp = fopen($filename, 'w'); //生成临时文件 - fwrite($fp, chr(0xEF).chr(0xBB).chr(0xBF));//转码,防止乱码 - if($header) fputcsv($fp, $header); - - foreach ($data as $a) { - fputcsv($fp, $a); - } - fclose($fp); //每生成一个文件关闭 - //下载 - header('Content-Type: application/vnd.ms-excel;charset=utf-8'); - header('Content-Disposition: attachment;filename="' . $title . '.csv"'); - header('Cache-Control: max-age=0'); - header('Content-Length: ' . filesize($filename)); - readfile($filename); - unlink($filename); - die(); -} //导出csv 新增字段排序功能 function data2csv(&$data,$title,$fields){ set_time_limit(0);