diff --git a/Application/Admin/Controller/FinancialSummarySetController.class.php b/Application/Admin/Controller/FinancialSummarySetController.class.php index 5cee8525f..096efdcc8 100644 --- a/Application/Admin/Controller/FinancialSummarySetController.class.php +++ b/Application/Admin/Controller/FinancialSummarySetController.class.php @@ -48,6 +48,9 @@ class FinancialSummarySetController extends \Think\Controller $this->date = $month; $tarry = explode('-',$month); + $this->year= $tarry[0]; + $this->month= $tarry[1]; + $this->beginThismonth=mktime(0,0,0,$tarry[1],1,$tarry[0]); $this->endThismonth=mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1; $this->reCount(); @@ -108,6 +111,7 @@ class FinancialSummarySetController extends \Think\Controller $this->getCashAndBalanCoinSpend(); $this->getBalanceCoinIncome(); $this->getGameSupersignIncome(); + $this->getTestUserIncome(); dump($this->adddata); # code... } @@ -164,7 +168,7 @@ class FinancialSummarySetController extends \Think\Controller "order_status"=>array("EGT",1) ); $COMoney= $this->CoinPayOrderModel->field("IFNULL(sum(pay_amount),0) pay_amount")->where($map1)->find()['pay_amount']; - $temparr['sum_money'] = number_format(($temparr['sum_money']*100+$COMoney*100)/100, 2, '.', ''); ; + $temparr['sum_money'] = number_format(($temparr['sum_money']*100+$COMoney*100)/100, 2, '.', ''); $this->adddata[]=$temparr; } //超级签购买收入 @@ -185,7 +189,45 @@ class FinancialSummarySetController extends \Think\Controller $temparr['sum_money'] = $this->GameSupersignModel->field("IFNULL(sum(pay_price),0) pay_price")->where($map)->find()['pay_price']; $this->adddata[]=$temparr; } - + //测试账号收入 + protected function getTestUserIncome() + { + $temparr = array( + "key_name"=>'test_user_income', + "type"=>1, + "sort"=>4, + "count_month"=>$this->month, + "count_year"=>$this->year, + "create_time"=>$this->nowdata + ); + //获取测试白名单 + $testlist = M("TestWhiteList",'tab_')->field("user_id")->select(); + if($testlist){ + $testlist = implode(",",array_column($testlist, 'user_id')); + }else{ + $testlist = false; + } + //获取现金充值 + $map = array( + "pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), + "pay_status"=>1, + "pay_way"=>array("GT",0) + ); + if($testlist) $map['user_id']=array("in",$testlist); + $cash_spend = $this->SpendModel + ->field("IFNULL(SUM(pay_amount),0) as pay_amount") + ->where($map) + ->find()['pay_amount']; + //获取平台币充值 + $map1 = array( + "create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), + "pay_status"=>1 + ); + if($testlist) $map1['user_id']=array("in",$testlist); + $deposit = $this->DepositModel->field("IFNULL(sum(pay_amount),0) pay_amount")->where($map1)->find()['pay_amount']; + $temparr['sum_money'] = number_format(($cash_spend*100+$deposit*100)/100, 2, '.', ''); + $this->adddata[]=$temparr; + }