|
|
@ -1187,12 +1187,8 @@ class ExportController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
if (I('platform_type', 0) != 0) {
|
|
|
|
if (I('platform_type', 0) != 0) {
|
|
|
|
$sy = I('platform_type', 0) == 1 ? '=' : '<>';
|
|
|
|
$sy = I('platform_type', 0) == 1 ? '=' : '<>';
|
|
|
|
$platformWhere = 'exists (select 1 from tab_game where id = tab_spend.game_id and unique_code ' . $sy . ' "")';
|
|
|
|
$game_id = M("Game","tab_")->where('unique_code ' . $sy . ' ""')->getField("id",true);
|
|
|
|
if (isset($map['_string']) && $map['_string']) {
|
|
|
|
$map['game_id'] = ['in',$game_id];
|
|
|
|
$map['_string'] = $map['_string'] . ' and ' . $platformWhere;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$map['_string'] = $platformWhere;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) {
|
|
|
|
// if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) {
|
|
|
@ -1204,7 +1200,7 @@ class ExportController extends Controller
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
$map1 = $map;
|
|
|
|
$map1 = $map;
|
|
|
|
$map1['pay_status'] = 1;
|
|
|
|
$map1['pay_status'] = 1;
|
|
|
|
$total = M('Spend','tab_')->where($map1)->sum('pay_amount');
|
|
|
|
$total = SM('Spend','tab_')->where($map1)->sum('pay_amount');
|
|
|
|
// var_dump($total);die();
|
|
|
|
// var_dump($total);die();
|
|
|
|
$total=$total?$total:0;
|
|
|
|
$total=$total?$total:0;
|
|
|
|
|
|
|
|
|
|
|
@ -1280,7 +1276,7 @@ class ExportController extends Controller
|
|
|
|
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
|
|
|
|
mb_convert_variables('GBK', 'UTF-8', $xlsCell);
|
|
|
|
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
|
|
|
|
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
|
|
|
|
|
|
|
|
|
|
|
|
$accessNum = D('Spend')
|
|
|
|
$accessNum = SM('Spend')
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->count();
|
|
|
|
->count();
|
|
|
|
|
|
|
|
|
|
|
@ -1289,7 +1285,7 @@ class ExportController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
// var_dump($count);die();
|
|
|
|
// var_dump($count);die();
|
|
|
|
for($i = 1; $i <= $pages; $i++) {
|
|
|
|
for($i = 1; $i <= $pages; $i++) {
|
|
|
|
$xlsData = D('Spend')
|
|
|
|
$xlsData = SM('Spend')
|
|
|
|
->field($fields)
|
|
|
|
->field($fields)
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->limit(($i-1)*$perSize ,$perSize)
|
|
|
|
->limit(($i-1)*$perSize ,$perSize)
|
|
|
|