From ee6c6e62b269220b4d8b05758ebd09aeb139da85 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 26 Dec 2019 17:51:16 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=85=85=E5=80=BC=E7=8E=A9=E5=AE=B6--?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 8 ++++++-- Application/Home/Controller/QueryController.class.php | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 3d5ecca69..5f672dec9 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -3238,9 +3238,13 @@ class DownloadController extends BaseController { $roles = M()->alias('record') ->table($subQuery) ->select(); - $total = M('spend','tab_')->alias('uc') - ->field("$fieldS,$fieldToday as recharge_cost_today") + $totalSql = M('spend', 'tab_')->alias('uc') + ->field("$fieldS, $fieldToday as recharge_cost_today") ->where($map) + ->buildSql(); + $total = M()->table($totalSql) + ->alias('total') + ->field('sum(recharge_cost) as recharge_cost, sum(recharge_count) as recharge_count, sum(recharge_cost_today) as recharge_cost_today') ->find(); $total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' :$total['recharge_cost_today']; $csvFileName = $xlsName.'.csv'; diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 73395f72c..9a5c3059b 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1872,9 +1872,13 @@ class QueryController extends BaseController list($records, $pagination, $count) = $this->paginate($query); - $total = M('spend', 'tab_')->alias('s') + $totalSql = M('spend', 'tab_')->alias('s') ->field("$fieldS, $fieldToday as recharge_cost_today") ->where($map) + ->buildSql(); + $total = M()->table($totalSql) + ->alias('total') + ->field('sum(recharge_cost) as recharge_cost, sum(recharge_count) as recharge_count, sum(recharge_cost_today) as recharge_cost_today') ->find(); $total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' : $total['recharge_cost_today']; From cc83e0e5850f6875e67c4252f547fb418fc2741f Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 26 Dec 2019 18:01:13 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=85=85=E5=80=BC=E7=8E=A9=E5=AE=B6--?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 9a5c3059b..6526204bc 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1872,14 +1872,15 @@ class QueryController extends BaseController list($records, $pagination, $count) = $this->paginate($query); - $totalSql = M('spend', 'tab_')->alias('s') - ->field("$fieldS, $fieldToday as recharge_cost_today") + $total = M('spend', 'tab_')->alias('s') + ->field($fieldS) ->where($map) - ->buildSql(); - $total = M()->table($totalSql) - ->alias('total') - ->field('sum(recharge_cost) as recharge_cost, sum(recharge_count) as recharge_count, sum(recharge_cost_today) as recharge_cost_today') ->find(); + $map['s.pay_time'] = $spendMap['today.pay_time']; + $total['recharge_cost_today'] = M('spend', 'tab_')->alias('s') + ->field('sum(s.pay_amount) as recharge_cost_today') + ->where($map) + ->find()['recharge_cost_today']; $total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' : $total['recharge_cost_today']; if (!empty($records)) { From ae2b498e45092a928f3027462351108fb662b6d5 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Thu, 26 Dec 2019 18:01:41 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AD=BE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/SuperStatistical/index.html | 4 +++- Application/Admin/View/SuperStatistical/superDetail.html | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Application/Admin/View/SuperStatistical/index.html b/Application/Admin/View/SuperStatistical/index.html index b0288070e..0b7b451f0 100644 --- a/Application/Admin/View/SuperStatistical/index.html +++ b/Application/Admin/View/SuperStatistical/index.html @@ -35,10 +35,12 @@
+
+ 返回 +
-
diff --git a/Application/Admin/View/SuperStatistical/superDetail.html b/Application/Admin/View/SuperStatistical/superDetail.html index ddd9b5dff..bec9f65a9 100644 --- a/Application/Admin/View/SuperStatistical/superDetail.html +++ b/Application/Admin/View/SuperStatistical/superDetail.html @@ -97,11 +97,11 @@
- - - - + + +
From 40da308a085f94ef0f378921f33b928869ff8019 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 26 Dec 2019 18:02:38 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=85=85=E5=80=BC=E7=8E=A9=E5=AE=B6--?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/DownloadController.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 5f672dec9..c29528030 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -3238,14 +3238,15 @@ class DownloadController extends BaseController { $roles = M()->alias('record') ->table($subQuery) ->select(); - $totalSql = M('spend', 'tab_')->alias('uc') - ->field("$fieldS, $fieldToday as recharge_cost_today") + $total = M('spend', 'tab_')->alias('uc') + ->field($fieldS) ->where($map) - ->buildSql(); - $total = M()->table($totalSql) - ->alias('total') - ->field('sum(recharge_cost) as recharge_cost, sum(recharge_count) as recharge_count, sum(recharge_cost_today) as recharge_cost_today') ->find(); + $map['uc.pay_time'] = $spendMap['today.pay_time']; + $total['recharge_cost_today'] = M('spend', 'tab_')->alias('uc') + ->field('sum(uc.pay_amount) as recharge_cost_today') + ->where($map) + ->find()['recharge_cost_today']; $total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' :$total['recharge_cost_today']; $csvFileName = $xlsName.'.csv'; //设置好告诉浏览器要下载excel文件的headers From 1c2bb7e584c392196f6c7d2d4b35f29008aee2f3 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Thu, 26 Dec 2019 18:03:54 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AD=BE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/SuperStatistical/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/View/SuperStatistical/index.html b/Application/Admin/View/SuperStatistical/index.html index 0b7b451f0..d8401c275 100644 --- a/Application/Admin/View/SuperStatistical/index.html +++ b/Application/Admin/View/SuperStatistical/index.html @@ -36,7 +36,7 @@
From 4e3206a5c1708f4b37c63cb37acd7559a6fffc97 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 26 Dec 2019 18:12:56 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=B8=A0=E9=81=93?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1bug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PayChannelController.class.php | 57 +++++++++++++---- Application/Admin/View/Deposit/lists.html | 30 ++++----- Application/Admin/View/PayChannel/index.html | 64 ++++++++++--------- 3 files changed, 93 insertions(+), 58 deletions(-) diff --git a/Application/Admin/Controller/PayChannelController.class.php b/Application/Admin/Controller/PayChannelController.class.php index 0e704efb2..b076bb96d 100644 --- a/Application/Admin/Controller/PayChannelController.class.php +++ b/Application/Admin/Controller/PayChannelController.class.php @@ -74,12 +74,11 @@ class PayChannelController extends ThinkController ->group("game_id") ->select(); - unset($coinMap['game_id']); +// unset($coinMap['game_id']); //平台币充值 $coinSum = M('deposit','tab_') ->where($coinMap) ->sum('tab_deposit.pay_amount'); -// var_dump($coinSum);die(); $data = array_merge($data,$coinData); $data = $this->unique_multi_array($data,'game_id'); @@ -177,7 +176,7 @@ class PayChannelController extends ThinkController // setPowerPromoteIds($spreadMap,'promote_id'); //推广后台 $spreadData = M("coin_pay_order","tab_") - ->field("0 as game_name,sum(real_amount) as pay_amount,0 as platform_coin,id as test_coin") + ->field("0 as game_name,sum(pay_amount) as pay_amount,0 as platform_coin,id as test_coin") ->where($spreadMap) ->find(); $spreadData['pay_amount'] = $spreadData['pay_amount']?$spreadData['pay_amount']:0; @@ -250,11 +249,18 @@ class PayChannelController extends ThinkController } //汇总数据 - $sumData['pay_amount'] = $sumData['pay_amount'] + $superSignData['pay_amount'] + $bindRechargeData['pay_amount']; - $sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin'] + - $offcialData['pay_amount'] + $spreadData['pay_amount']; - $sumData['test_coin'] = $sumData['test_coin']+$offcialTestCost+$testSuperSignCost+$sumData['test_platform_coin']; - $sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin']; + if ($_REQUEST['game_id']) { + $sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin']; + $sumData['test_coin'] = $sumData['test_coin']+$sumData['test_platform_coin']; + $sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin']; + } else { + $sumData['pay_amount'] = $sumData['pay_amount'] + $superSignData['pay_amount'] + $bindRechargeData['pay_amount']; + $sumData['platform_coin'] = $sumData['platform_coin'] - $sumData['test_platform_coin'] + + $offcialData['pay_amount'] + $spreadData['pay_amount']; + $sumData['test_coin'] = $sumData['test_coin']+$offcialTestCost+$testSuperSignCost+$sumData['test_platform_coin']; + $sumData['sum'] = $sumData['pay_amount'] +$sumData['test_coin'] + $sumData['platform_coin']; + $coinSum = $coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost; + } if($_REQUEST['export'] == 1) { @@ -276,7 +282,7 @@ class PayChannelController extends ThinkController $payTypeDataExport['pay_amount'] .= $key.':'.$value." "; } } - $payTypeDataExport['pay_amount'] .= "平台币直充金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计):". + $payTypeDataExport['pay_amount'] .= "平台币直充总金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计):". ($coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost); $channelDataExport['game_name'] = '支付渠道'; @@ -288,6 +294,12 @@ class PayChannelController extends ThinkController unset($sumData['test_platform_coin']); + if ($_REQUEST['game_id']) { + unset($superSignData); + unset($offcialData); + unset($spreadData); + } + db2csv(array_merge(array_merge(array_merge(array_merge( array_merge(array_merge( array_merge($data,[0=>$superSignData]),[0=>$offcialData])),[0=>$spreadData],[0=>$sumData])),[0=>$payTypeDataExport]),[0=>$channelDataExport]),'支付渠道统计导出',$title); @@ -296,8 +308,9 @@ class PayChannelController extends ThinkController $this->meta_title = "支付渠道统计"; $size = $row;//每页显示的记录数 $data = array_slice($data, ($arraypage - 1) * $size, $size); + //平台币直充金额,下面列表 - $this->assign('coinSum',$coinSum + $offcialData['pay_amount'] + $spreadData['pay_amount']+$offcialTestCost); + $this->assign('coinSum',$coinSum); $this->assign('sumData',$sumData); $this->assign('channelData',$channelData); @@ -374,6 +387,20 @@ class PayChannelController extends ThinkController ->where($map) ->group('pay_way') ->select(false); + if ($_REQUEST['game_id']) { + $map['tab_deposit.pay_way'] = $map['pay_way']; + $map['tab_deposit.create_time'] = $map['create_time']; + $map['tab_deposit.pay_source'] = 2; + $map['tab_pay_info.extend'] = ''; + unset($map['pay_way']); + unset($map['create_time']); + $depositData = M('pay_info','tab_') + ->join("inner join tab_deposit on tab_pay_info.order_id=tab_deposit.pay_order_number") + ->field('sum(pay_amount) as pay_amount,tab_deposit.pay_way as pay_way') + ->where($map) + ->group('tab_deposit.pay_way') + ->select(false); + } $bindMap['pay_status'] = 1; $bindMap['pay_way'] = array('egt',1); @@ -390,8 +417,14 @@ class PayChannelController extends ThinkController ->where($bindMap) ->select(false); + if(!$_REQUEST['game_id']) { + $sql = "{$channelData} UNION ALL {$depositData} UNION ALL {$superSignDataPay} UNION ALL {$spreadDataPay} UNION ALL {$bindRechargeData}"; + } else { + $sql = "{$channelData} UNION ALL {$depositData}"; + } + //将语句整合起来查询 - $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 ({$sql})t group by pay_way;"; // var_dump($channelData);die(); $channelData = M()->query($channelData); @@ -482,7 +515,7 @@ class PayChannelController extends ThinkController // setPowerPromoteIds($spreadMap,'promote_id'); // $spreadMap['pay_way'] = array('egt',1); $coin_pay_order = M('coin_pay_order','tab_') - ->field("pay_order_number,create_time as pay_time,promote_account,pay_amount as cost,real_amount as pay_amount,pay_way") + ->field("pay_order_number,create_time as pay_time,promote_account,pay_amount,real_amount as cost,pay_way") ->where($spreadMap) ->select(false); diff --git a/Application/Admin/View/Deposit/lists.html b/Application/Admin/View/Deposit/lists.html index 488c82a12..2f11a20f0 100644 --- a/Application/Admin/View/Deposit/lists.html +++ b/Application/Admin/View/Deposit/lists.html @@ -78,21 +78,21 @@
-
- - - -
-
- -
+ + + + + + + + + + + + + + +
diff --git a/Application/Admin/View/PayChannel/index.html b/Application/Admin/View/PayChannel/index.html index 195d04db9..4ff7ed276 100644 --- a/Application/Admin/View/PayChannel/index.html +++ b/Application/Admin/View/PayChannel/index.html @@ -176,36 +176,38 @@ - - 超级签 - {$superSignData['pay_amount']}0 - 0 - {$superSignData.test_coin}0 - {$superSignData['sum']}0 - - 订单查看 - - - - 官网 - 0 - {$offcialData['pay_amount']} - {$offcialData.test_coin}0 - {$offcialData['sum']}0 - - 订单查看 - - - - 推广后台 - 0 - {$spreadData['pay_amount']} - 0 - {$spreadData['sum']}0 - - 订单查看 - - + + + 超级签 + {$superSignData['pay_amount']}0 + 0 + {$superSignData.test_coin}0 + {$superSignData['sum']}0 + + 订单查看 + + + + 官网 + 0 + {$offcialData['pay_amount']} + {$offcialData.test_coin}0 + {$offcialData['sum']}0 + + 订单查看 + + + + 推广后台 + 0 + {$spreadData['pay_amount']} + 0 + {$spreadData['sum']}0 + + 订单查看 + + + 汇总 {$sumData['pay_amount']}0 @@ -225,7 +227,7 @@ {$key}:{$payTypeData}          - 平台币直充金额(2019.12.18号以前的不显示在列表中,此项也不计入充值方式统计){$coinSum}0 + 平台币直充总金额(2019.12.18号以前的无法对应游戏记录不显示在列表中,此项也不计入充值方式统计){$coinSum}0