@ -333,15 +333,18 @@ class PayChannelController extends ThinkController
//推广后台充值数据
//推广后台充值数据
$spreadMap['order_status'] = array('egt',1);
$spreadMap['order_status'] = array('egt',1);
$spreadMap['pay_way'] = array('egt',1);
$spreadMap['pay_way'] = array('egt',1);
if($map['pay_time']) {
$spreadMap['create_time'] = $map['pay_time'];
$spreadMap['create_time'] = $map['pay_time'];
}
//推广后台
//推广后台
$spreadDataPay = M("coin_pay_order","tab_")
$spreadDataPay = M("coin_pay_order","tab_")
->field("sum(pay_amount) as pay_amount,pay_way")
->field("sum(pay_amount) as pay_amount,pay_way")
->where($spreadMap)
->where($spreadMap)
->select(false);
->select(false);
if ($map['pay_time']) {
$map['create_time'] = $map['pay_time'];
$map['create_time'] = $map['pay_time'];
unset($map['pay_time']);
unset($map['pay_time']);
}
//充值平台币数据
//充值平台币数据
$depositData = M('deposit','tab_')
$depositData = M('deposit','tab_')
->field('sum(pay_amount) as pay_amount,pay_way')
->field('sum(pay_amount) as pay_amount,pay_way')
@ -349,14 +352,20 @@ class PayChannelController extends ThinkController
->group('pay_way')
->group('pay_way')
->select(false);
->select(false);
$bindMap['pay_status'] = 1;
$bindMap['pay_way'] = array('egt',1);
if($_REQUEST['game_id']) {
$bindMap['game_id'] =$_REQUEST['game_id'];
}
if ($map['pay_time']) {
$bindMap['create_time'] = $map['pay_time'];
}
$bindRechargeData = M('bind_recharge','tab_')
$bindRechargeData = M('bind_recharge','tab_')
->field('sum(real_amount) as pay_amount,pay_way')
->field('sum(real_amount) as pay_amount,pay_way')
->where(array('pay_status'=>1,'pay_way'=>array('egt',1),'game_id'=>$_REQUEST['game_id'],'create_time'=>$map['pay_time']))
->where($bindMap )
->select(false);
->select(false);
// var_dump($spreadDataPay);die();
//将语句整合起来查询
//将语句整合起来查询
$channelData = "select sum(pay_amount) as pay_amount,pay_way from ({$channelData} UNION ALL {$depositData} UNION ALL {$superSignDataPay} UNION ALL {$spreadDataPay} UNION ALL {$bindRechargeData})t group by pay_way;";
$channelData = "select sum(pay_amount) as pay_amount,pay_way from ({$channelData} UNION ALL {$depositData} UNION ALL {$superSignDataPay} UNION ALL {$spreadDataPay} UNION ALL {$bindRechargeData})t group by pay_way;";
// var_dump($channelData);die();
// var_dump($channelData);die();