Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
yulingwei 5 years ago
commit 501ed6c494

@ -1163,9 +1163,6 @@ class DownloadController extends BaseController {
* @author sunke * @author sunke
*/ */
public function recharge_data_export() { public function recharge_data_export() {
if (empty(I('begtime')) || empty(I('endtime'))) {
$this->error('请选择起止时间');
}
$beginTime = strtotime(I('begtime') . ' 00:00:00'); $beginTime = strtotime(I('begtime') . ' 00:00:00');
$endtime = strtotime(I('endtime') . ' 23:59:59'); $endtime = strtotime(I('endtime') . ' 23:59:59');
if (($endtime - $beginTime) > 31 * 24 * 3600) { if (($endtime - $beginTime) > 31 * 24 * 3600) {
@ -2439,7 +2436,7 @@ class DownloadController extends BaseController {
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages - 1; $i++) { for($i = 1; $i <= $pages; $i++) {
foreach($data as $value) { foreach($data as $value) {
mb_convert_variables('GBK', 'UTF-8', $value); mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value); fputcsv($fp, $value);
@ -2952,7 +2949,7 @@ class DownloadController extends BaseController {
->where($map) ->where($map)
->order('tab_spend.id desc') ->order('tab_spend.id desc')
->select(); ->select();
$csvFileName = $xlsName.'.csv'; $csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers //设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer'); header('Content-Description: File Transfer');
@ -2967,6 +2964,7 @@ class DownloadController extends BaseController {
$accessNum = count($data1)?:0 ; $accessNum = count($data1)?:0 ;
$perSize = 5000;//每次查询的条数 $perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$model = M('spend','tab_'); $model = M('spend','tab_');
$data = $model $data = $model
@ -3017,12 +3015,10 @@ class DownloadController extends BaseController {
$csvData["p_proinfo"] = $value1["p_proinfo"]; $csvData["p_proinfo"] = $value1["p_proinfo"];
$csvData["proinfo"] = $value1["proinfo"]; $csvData["proinfo"] = $value1["proinfo"];
$csvData["pay_time"] = $value1["pay_time"]; $csvData["pay_time"] = $value1["pay_time"];
mb_convert_variables('GBK', 'UTF-8', $csvData);
fputcsv($fp, $csvData);
$xlsData[] = $csvData; $xlsData[] = $csvData;
} }
foreach($xlsData as $value) {
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
}
unset($xlsData); unset($xlsData);
ob_flush(); ob_flush();
flush(); flush();

Loading…
Cancel
Save