|
|
|
@ -1235,16 +1235,10 @@ class ExportController extends Controller
|
|
|
|
|
|
|
|
|
|
} else if (isset($_REQUEST['promote_id']) && $_REQUEST['promote_id'] == 0) {
|
|
|
|
|
$map['promote_id'] = array('elt', 0);
|
|
|
|
|
unset($_REQUEST['promote_id']);
|
|
|
|
|
unset($_REQUEST['promote_name']);
|
|
|
|
|
} elseif (isset($_REQUEST['promote_name']) && $_REQUEST['promote_id'] == -1) {
|
|
|
|
|
$map['promote_id'] = get_promote_id($_REQUEST['promote_name']);
|
|
|
|
|
unset($_REQUEST['promote_id']);
|
|
|
|
|
unset($_REQUEST['promote_name']);
|
|
|
|
|
} else {
|
|
|
|
|
$map['promote_id'] = $_REQUEST['promote_id'];
|
|
|
|
|
unset($_REQUEST['promote_id']);
|
|
|
|
|
unset($_REQUEST['promote_name']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) {
|
|
|
|
|
$map['create_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1));
|
|
|
|
@ -1266,30 +1260,70 @@ class ExportController extends Controller
|
|
|
|
|
}
|
|
|
|
|
$map1 = $map;
|
|
|
|
|
$map1['pay_status'] = 1;
|
|
|
|
|
$total = D('Deposit')->where($map1)->sum('pay_amount');
|
|
|
|
|
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
|
|
|
|
|
$total = sprintf("%.2f", 0);
|
|
|
|
|
|
|
|
|
|
if($_REQUEST['promote_id']||$_REQUEST['promote_id']=='0') {
|
|
|
|
|
|
|
|
|
|
$map1['order_status'] = 1;
|
|
|
|
|
unset($map1['pay_status']);
|
|
|
|
|
if ($map['pay_status']) {
|
|
|
|
|
$map['order_status']=$map['pay_status'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$total=null_to_0(D('coin_pay_order')->where($map1)->sum('pay_amount'));
|
|
|
|
|
|
|
|
|
|
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
|
|
|
|
|
$total = sprintf("%.2f", 0);
|
|
|
|
|
} else {
|
|
|
|
|
$total = sprintf("%.2f", $total);
|
|
|
|
|
}
|
|
|
|
|
$xlsCell = array(
|
|
|
|
|
array('pay_order_number', "订单号"),
|
|
|
|
|
array('promote_account', L('Subordinate_channel')),
|
|
|
|
|
array('pay_amount', "充值平台币"),
|
|
|
|
|
array('pay_way', "充值方式", 'get_pay_way', '*'),
|
|
|
|
|
array('create_time', "充值时间"),
|
|
|
|
|
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
|
|
|
|
|
array('', "共计充值{$total}"),
|
|
|
|
|
);
|
|
|
|
|
$xlsData = D('coin_pay_order')
|
|
|
|
|
/* 查询指定字段,不指定则查询所有字段 */
|
|
|
|
|
->field('*,order_status as pay_status')
|
|
|
|
|
// 查询条件
|
|
|
|
|
->where($map)
|
|
|
|
|
/* 默认通过id逆序排列 */
|
|
|
|
|
->order("id desc")
|
|
|
|
|
/* 执行查询 */
|
|
|
|
|
->select();
|
|
|
|
|
// var_dump($xlsData);die();
|
|
|
|
|
foreach ($xlsData as $key => $value) {
|
|
|
|
|
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$total = sprintf("%.2f", $total);
|
|
|
|
|
}
|
|
|
|
|
$total = D('Deposit')->where($map1)->sum('pay_amount');
|
|
|
|
|
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
|
|
|
|
|
$total = sprintf("%.2f", 0);
|
|
|
|
|
} else {
|
|
|
|
|
$total = sprintf("%.2f", $total);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$xlsCell = array(
|
|
|
|
|
array('pay_order_number', "订单号"),
|
|
|
|
|
array('user_account', "玩家账号"),
|
|
|
|
|
array('promote_account', L('Subordinate_channel')),
|
|
|
|
|
array('pay_amount', "充值平台币"),
|
|
|
|
|
array('pay_way', "充值方式", 'get_pay_way', '*'),
|
|
|
|
|
array('pay_ip', "充值ip"),
|
|
|
|
|
array('create_time', "充值时间"),
|
|
|
|
|
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
|
|
|
|
|
array('', "共计充值{$total}"),
|
|
|
|
|
);
|
|
|
|
|
$xlsData = D('Deposit')
|
|
|
|
|
->where($map)
|
|
|
|
|
->order('id DESC')
|
|
|
|
|
->select();
|
|
|
|
|
foreach ($xlsData as $key => $value) {
|
|
|
|
|
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
|
|
|
|
|
$xlsCell = array(
|
|
|
|
|
array('pay_order_number', "订单号"),
|
|
|
|
|
array('user_account', "玩家账号"),
|
|
|
|
|
array('promote_account', L('Subordinate_channel')),
|
|
|
|
|
array('pay_amount', "充值平台币"),
|
|
|
|
|
array('pay_way', "充值方式", 'get_pay_way', '*'),
|
|
|
|
|
array('pay_ip', "充值ip"),
|
|
|
|
|
array('create_time', "充值时间"),
|
|
|
|
|
array('pay_status', L('Order_status'), 'get_info_status', '*', '9'),
|
|
|
|
|
array('', "共计充值{$total}"),
|
|
|
|
|
);
|
|
|
|
|
$xlsData = D('Deposit')
|
|
|
|
|
->where($map)
|
|
|
|
|
->order('id DESC')
|
|
|
|
|
->select();
|
|
|
|
|
foreach ($xlsData as $key => $value) {
|
|
|
|
|
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// dd($xlsData);
|
|
|
|
|
break;
|
|
|
|
|