diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 2e7771580..cb9d01bc4 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2371,6 +2371,88 @@ class ExportController extends Controller // dd($xlsData); break; + case 27: + $xlsCell = array( + array('server_type', '服务器类型'), + array('order_type', '订单类型'), + array('order_no', '支付订单号'), + array('cp_order_no', 'cp订单号'), + array('user_account', '测试账号'), + array('pay_time', '充值时间'), + array('game_name', '游戏名称'), + array('order_amount', '订单金额'), + array('pay_amount', '实付金额'), + array('pay_way', '充值方式'), + array('add_time', '录入时间'), + ); + + $params = I('get.'); + // if(isset($params['timestart']) && isset($params['timeend'])) { + // $startTime = strtotime($params['timestart']); + // $endTime = strtotime($params['timeend']) + 86399; + // $map['tab_test_order.pay_time'] = array('BETWEEN', [$startTime, $endTime]); + // } + + if(isset($params['server_type'])) { + $map['tab_test_order.server_type'] = $params['server_type']; + } + + if(isset($params['order_type'])) { + $map['tab_test_order.order_type'] = $params['order_type']; + } + + if(isset($params['order_no'])) { + $map['tab_test_order.order_no'] = $params['order_no']; + } + + if(isset($params['user_account'])) { + $map['tab_test_order.user_account'] = $params['user_account']; + } + + if(isset($params['pay_way'])) { + $map['tab_test_order.pay_way'] = $params['pay_way']; + } + + if(!empty($params['timestart']) && !empty($params['timeend'])){ + $timestart = strtotime($params['timestart']); + $timeend = strtotime($params['timeend'])+86399; + $map['tab_test_order.pay_time'] = array("between",array($timestart,$timeend)); + }else if(!empty($params['timestart']) && empty($params['timeend'])) { + $timestart = strtotime($params['timestart']); + $map['tab_test_order.pay_time'] = array("EGT",$timestart); + }else if (!empty($params['timeend']) && empty($params['timestart'])) { + $timeend = strtotime($params['timeend'])+86399; + $map['tab_test_order.pay_time'] = array("ELT",$timeend); + } + + + $orderData = M('test_order', 'tab_')->where($map)->page($page,$row)->order('add_time desc')->select(); + $sum_order_amount = M('test_order', 'tab_')->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find(); + $sum_pay_amount = M('test_order', 'tab_')->where($map)->field('sum(pay_amount) as sum_order_amount')->find(); + $xlsData = []; + foreach($orderData as $k => $v) { + if ($v['server_type'] == 1) { + $order_list['server_type'] = '测试内网'; + }else { + $order_list['server_type'] = '测试外网'; + } + $order_list['order_type'] = get_order_type($v['order_type']); + $order_list['order_no'] = $v['order_no']; + $order_list['cp_order_no'] = $v['cp_order_no']; + $order_list['user_account'] = $v['user_account']; + $order_list['pay_time'] = date('Y-m-d H:i:s', $v['pay_time']); + $order_list['game_name'] = $v['game_name']; + $order_list['order_amount'] = $v['order_amount']; + $order_list['pay_amount'] = $v['pay_amount']; + $order_list['pay_way'] = get_pay_way($v['pay_way']); + $order_list['add_time'] = date('Y-m-d H:i:s', $v['add_time']); + $xlsData[] = $order_list; + } + $sumData = [['server_type'=>'总计', + 'order_amount'=>$sum_order_amount['sum_order_amount'], + 'pay_amount'=>$sum_pay_amount['sum_order_amount']]]; + $xlsData = array_merge($xlsData,$sumData); + break; default: $xlsName = $xlsCell = $xlsData = []; diff --git a/Application/Admin/View/TestOrder/lists.html b/Application/Admin/View/TestOrder/lists.html index db4673c94..ba6c22f41 100644 --- a/Application/Admin/View/TestOrder/lists.html +++ b/Application/Admin/View/TestOrder/lists.html @@ -185,6 +185,9 @@
+ + 导出 + {$_page|default=''}
diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 117f7f88b..9541e2c70 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -3283,7 +3283,7 @@ class DownloadController extends BaseController { $promoteGroup = isset($promotes[$list['promote_id']]) ? $promoteService->getGroupNameByChain($promotes[$list['promote_id']]['chain'], $list['promote_id']) : ''; $csvData["pay_order_number"] = $list["pay_order_number"]; - $csvData["game_name"] = $list["game_name"]; + $csvData["game_name"] = substr($list["game_name"],0,strrpos($list["game_name"],'(')); $csvData["user_account"] = $list["user_account"]; $csvData["promote_account"] = $list["promote_account"] . ($promoteGroup == '' ? '' : '(' . $promoteGroup . ')'); $csvData["pay_amount"] = $list["pay_amount"];