master
yulingwei 4 years ago
parent 0472fe9cbc
commit 99fcc4cbbb

@ -1068,7 +1068,6 @@ class ExportController extends Controller
); );
break; break;
case 7: case 7:
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart']; $startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend']; $endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
@ -1206,15 +1205,20 @@ class ExportController extends Controller
// ->join($tab_promote_join) // ->join($tab_promote_join)
// ->order('pay_time DESC') // ->order('pay_time DESC')
// ->select(); // ->select();
->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account, tab_promote_company.company_name, spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') ->field('pay_order_number,extend,pay_time,payed_time,user_account,game_name,promote_account, 0 as company_name, spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status, promote_id')
->join('tab_promote on tab_promote.id = tab_spend.promote_id', 'left') // ->join('tab_promote on tab_promote.id = tab_spend.promote_id', 'left')
->join('tab_promote_company on tab_promote_company.id and tab_promote.company_id', 'left') // ->join('tab_promote_company on tab_promote_company.id and tab_promote.company_id', 'left')
->where($map) ->where($map)
->limit(($i-1)*$perSize ,$perSize) ->limit(($i-1)*$perSize ,$perSize)
->order($order ? $order : 'pay_time desc') ->order($order ? $order : 'pay_time desc')
->select(); ->select();
$promoters = D('Promote')->where(['id'=>['in', array_unique(array_column($xlsData, 'promote_id'))]])->field('id, company_id')->select();
$promoters = $promoters ? array_column($promoters, 'company_id', 'id') : [];
$companys = $promoters ? M('promote_company', 'tab_')->where(['id'=>['in', array_unique(array_values($promoters))]])->field('id, company_name')->select() : [];
$companys = $companys ? array_column($companys, 'company_name', 'id') : [];
foreach($xlsData as $value) { foreach($xlsData as $value) {
$value['company_name'] = $promoters[$value['promote_id']] == 0 ? '官方渠道' : ($companys[$promoters[$value['promote_id']]] ?? '');
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']); $value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
if($value['pay_status'] == 1) { if($value['pay_status'] == 1) {
$value['payed_time'] = date('Y-m-d H:i:s',$value['payed_time']); $value['payed_time'] = date('Y-m-d H:i:s',$value['payed_time']);

Loading…
Cancel
Save