diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index ac2869e08..770a16df5 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -985,7 +985,7 @@ class FinanceController extends ThinkController //获取现金充值 $cashStatistics = M('spend', 'tab_') ->field('pay_way,SUM(pay_amount) AS pay_amount') - ->where(['pay_status' => 1]) + ->where(['pay_status' => 1,'pay_way'=>['egt',1]]) ->group('pay_way') ->select(); foreach ($cashStatistics as $key => $value) { @@ -996,11 +996,13 @@ class FinanceController extends ThinkController // dd($cashStatistics); //获取平台币充值 $deposit = M('deposit', 'tab_')->where([ - 'deposit' => 2, - 'pay_status' => 1, - 'pay_way' => ['gt', 0], - ])->field('pay_way, SUM(pay_amount) AS balance') - ->group('pay_way') + 'pay_source' => 2, + 'tab_deposit.pay_status' => 1, + 'tab_deposit.pay_way' => ['gt', 0], + 'extend'=>['eq',''] + ])->field('tab_deposit.pay_way, SUM(tab_deposit.pay_amount) AS balance') + ->join("inner join tab_pay_info on tab_pay_info.order_id=tab_deposit.pay_order_number") + ->group('tab_deposit.pay_way') ->select(); foreach ($deposit as $key => $value) { if (!array_key_exists($value['pay_way'], $cashStatistics)) { @@ -1010,9 +1012,104 @@ class FinanceController extends ThinkController } $cashStatistics[$value['pay_way']]['balance'] = $value['balance'];//别表的平台币充值 } + + //超级签数据 + $superSignData = M('game_supersign','tab_') + ->field("pay_way,sum(pay_price) as pay_amount") + ->where([ + 'pay_status' => 1, + 'pay_way' => ['gt', 0], + ]) + ->group('pay_way') + ->select(); + foreach ($superSignData as $key => $value) { + if (!array_key_exists($value['pay_way'], $cashStatistics)) { + $cashStatistics[$value['pay_way']] = $value; + $cashStatistics[$value['pay_way']]['pay_amount'] = '0.00'; + $cashStatistics[$value['pay_way']]['pay_type'] = getPayType($value['pay_way']);//充值方式文字影视 + } + $cashStatistics[$value['pay_way']]['pay_amount'] += $value['pay_amount'];//别表的平台币充值 + } + //绑定币数据 + $bindRechargeData = M('bind_recharge','tab_') + ->field('pay_way,sum(real_amount) as pay_amount') + ->where([ + 'pay_status' => 1, + 'pay_way' => ['gt', 0], + ]) + ->group('pay_way') + ->select(); + + foreach ($bindRechargeData as $key => $value) { + + if ($value['pay_way'] == NULL&&$value['pay_amount'] == NULL) { + continue; + } + + if (!array_key_exists($value['pay_way'], $cashStatistics)) { + $cashStatistics[$value['pay_way']] = $value; + $cashStatistics[$value['pay_way']]['pay_amount'] = '0.00'; + $cashStatistics[$value['pay_way']]['pay_type'] = getPayType($value['pay_way']);//充值方式文字影视 + } + $cashStatistics[$value['pay_way']]['pay_amount'] += $value['pay_amount'];//别表的平台币充值 + } + + //推广后台 + $spreadData = M("coin_pay_order","tab_") + ->field("pay_way,sum(real_amount) as pay_amount") + ->where([ + 'order_status'=>['egt',1], + 'pay_way'=>['egt',1] + ]) + ->group('pay_way') + ->select(); + + foreach ($spreadData as $key => $value) { + + if ($value['pay_way'] == NULL&&$value['pay_amount'] == NULL) { + continue; + } + + if (!array_key_exists($value['pay_way'], $cashStatistics)) { + $cashStatistics[$value['pay_way']] = $value; + $cashStatistics[$value['pay_way']]['pay_amount'] = '0.00'; + $cashStatistics[$value['pay_way']]['pay_type'] = getPayType($value['pay_way']);//充值方式文字影视 + } + $cashStatistics[$value['pay_way']]['pay_amount'] += $value['pay_amount'];//别表的平台币充值 + } + //官网充值 + $offcialmap['pay_status'] = 1; + $offcialmap['pay_way'] = array('egt',1); + $offcialmap['pay_source'] = 0; + + $offcialData = M('deposit','tab_') + ->field("pay_way,sum(pay_amount) as pay_amount") + ->where([ + 'pay_status'=>1, + 'pay_way'=>['egt',1], + 'pay_source'=>0, + ]) + ->group('pay_way') + ->select(); + + foreach ($offcialData as $key => $value) { + + if ($value['pay_way'] == NULL&&$value['pay_amount'] == NULL) { + continue; + } + + if (!array_key_exists($value['pay_way'], $cashStatistics)) { + $cashStatistics[$value['pay_way']] = $value; + $cashStatistics[$value['pay_way']]['pay_amount'] = '0.00'; + $cashStatistics[$value['pay_way']]['pay_type'] = getPayType($value['pay_way']);//充值方式文字影视 + } + $cashStatistics[$value['pay_way']]['pay_amount'] += $value['pay_amount'];//别表的平台币充值 + } + foreach ($cashStatistics as $key => $value) { $cashStatistics[$key]['total'] = $value['pay_amount'] + $value['balance'];//添加列表合计 } +// var_dump($cashStatistics);die(); //底部总计 $all_pay_amount = array_sum(array_column($cashStatistics, 'pay_amount'));//现金充值总计 $all_balance = array_sum(array_column($cashStatistics, 'balance'));//平台币充值总计 diff --git a/Application/Admin/View/Finance/payTypeStatistics.html b/Application/Admin/View/Finance/payTypeStatistics.html index bd3d62ea8..9c2c60996 100644 --- a/Application/Admin/View/Finance/payTypeStatistics.html +++ b/Application/Admin/View/Finance/payTypeStatistics.html @@ -73,6 +73,10 @@