@ -924,6 +924,7 @@ public function auto_rrdae(){
$map['pay_status'] = 1;
$map['pay_game_status'] = 1;
$map['game_player_id'] = ['gt', 0];
$map['server_id'] = ['gt', 0];
$field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,promote_id,user_id,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count';
$spendData = M('spend', 'tab_')->field($field)
->where($map)
@ -532,15 +532,17 @@ class ExportController extends Controller
}
unset($xlsData[$k]['age_status']);
unset($xlsData[$k]['register_way']);
mb_convert_variables('GBK', 'UTF-8', $v);
fputcsv($fp, $v);
foreach($xlsData as $value) {
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
$lastId = $value['id'];
// foreach($xlsData as $value) {
// mb_convert_variables('GBK', 'UTF-8', $value);
// fputcsv($fp, $value);
// $lastId = $value['id'];
// }
unset($xlsData);//释放变量的内存
//刷新输出缓冲到浏览器
ob_flush();