From 9631a26d40eed75236508e2954ea6fd6e0852cc4 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 25 May 2021 11:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/GameMarginController.class.php | 6 +++--- .../Admin/Controller/GameMarginSetController.class.php | 10 ++++++---- Application/Admin/View/GameMargin/marginView.html | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Application/Admin/Controller/GameMarginController.class.php b/Application/Admin/Controller/GameMarginController.class.php index 0fb582a6a..821d95f46 100644 --- a/Application/Admin/Controller/GameMarginController.class.php +++ b/Application/Admin/Controller/GameMarginController.class.php @@ -107,7 +107,7 @@ class GameMarginController extends AdminController $count['jh_margin_amount'] += $v['jh_margin_amount']; } - $count['cp_ratio'] = round( $count['cp_statement_amount']/$count['pay_amount'] ,4)*100; + // $count['cp_ratio'] = round( $count['cp_statement_amount']/$count['pay_amount'] ,4)*100; $count['pu_ratio'] = round( $count['pu_statement_amount']/$count['pu_pay_amount'] ,4)*100; $count['pu_margin_ratio'] = round( $count['pu_margin_amount']/$count['pu_pay_amount'] ,4)*100; @@ -129,7 +129,7 @@ class GameMarginController extends AdminController $line = 3; foreach ($marginInfo as &$v) { - $v["cp_ratio"] = "=ROUND(G{$line}/D{$line},4)"; + // $v["cp_ratio"] = "=ROUND(G{$line}/D{$line},4)"; if($v["pc_pay_amount"] > 0){ $v["pc_ratio"] ="=ROUND(M{$line}/K{$line},4)"; @@ -159,7 +159,7 @@ class GameMarginController extends AdminController $count = [ "pay_amount"=>"=SUM(D3:D{$line})", - "cp_ratio"=>"=ROUND(G{$countLine}/D{$countLine},4)", + // "cp_ratio"=>"=ROUND(G{$countLine}/D{$countLine},4)", "cp_statement_amount"=>"=SUM(G3:G{$line})", "cp_rebate_amount"=>"=SUM(I3:I{$line})", "cp_other_amount"=>"=SUM(J3:J{$line})", diff --git a/Application/Admin/Controller/GameMarginSetController.class.php b/Application/Admin/Controller/GameMarginSetController.class.php index 02729dfa4..7180077a3 100644 --- a/Application/Admin/Controller/GameMarginSetController.class.php +++ b/Application/Admin/Controller/GameMarginSetController.class.php @@ -61,8 +61,8 @@ class GameMarginSetController extends Controller { { $this->getInsideCompanyid(); $this->getAllGameSpend(); - $this->getCpStatement(); $this->getJuheStatement(); + $this->getCpStatement(); $this->getPuStatement(); $this->getPcStatement(); $this->setMarginCount(); @@ -91,7 +91,7 @@ class GameMarginSetController extends Controller { "is_refund"=>0, "payed_time"=>["between",[$this->beginThismonth,$this->endThismonth]] ]; - $this->adddata = M("Spend","tab_")->where($where)->group("relation_game_name")->getField("substring_index(game_name, '(', 1) relation_game_name,SUM(pay_amount) pay_amount",true); + $this->adddata = M("Spend","tab_")->where($where)->group("relation_game_name")->order("pay_amount desc")->getField("substring_index(game_name, '(', 1) relation_game_name,SUM(pay_amount) pay_amount",true); } /** * 获取聚合数据 @@ -347,13 +347,15 @@ class GameMarginSetController extends Controller { if( !array_key_exists($game,$this->adddata) ){ continue; } - $statement_money = round( $this->adddata[$game]['pay_amount'] / $val['pay_amount'] * $val['sum_money'],2); + $ratio = $val['first_ratio']; + $statement_money = round( $this->adddata[$game]['pay_amount'] * $ratio / 100,2); if( array_key_exists("cp_statement_amount",$this->adddata[$game]) ){ $this->adddata[$game]['cp_statement_amount'] += $statement_money; }else{ $this->adddata[$game]['cp_statement_amount'] = $statement_money; } $this->adddata[$game]['cp_promote_ratio'] = $val['promote_ratio']; + $this->adddata[$game]['cp_ratio'] = $ratio; } } } @@ -437,7 +439,7 @@ class GameMarginSetController extends Controller { $pay_amount = 0; foreach ($this->adddata as &$v) { foreach ($baseCell as $bkey=>$bval) array_key_exists($bkey,$v) ?: $v[$bkey] = $bval; - $v["cp_ratio"] = round($v["cp_statement_amount"]/$v['pay_amount'],4)*100; + // $v["cp_ratio"] = round($v["cp_statement_amount"]/$v['pay_amount'],4)*100; if($v["pc_pay_amount"] > 0){ $v["pc_ratio"] = round($v["pc_statement_amount"]/$v['pc_pay_amount'],4)*100; diff --git a/Application/Admin/View/GameMargin/marginView.html b/Application/Admin/View/GameMargin/marginView.html index 8ea0d64fa..46ee0e902 100644 --- a/Application/Admin/View/GameMargin/marginView.html +++ b/Application/Admin/View/GameMargin/marginView.html @@ -162,7 +162,7 @@ {$margin["relation_game_name"]} {$margin["pay_amount"]} {$margin["cp_promote_ratio"]}% - {$margin["cp_ratio"]}{$percent} + {$margin["cp_ratio"]}% {$margin["cp_statement_amount"]} {$margin["cp_rebate_ratio"]}% {$margin["cp_rebate_amount"]} @@ -198,7 +198,7 @@ 小计 {$count["pay_amount"]} - {$count["cp_ratio"]}{$percent} + {$count["cp_statement_amount"]} {$count["cp_rebate_amount"]}