diff --git a/Application/Admin/Controller/GameMarginController.class.php b/Application/Admin/Controller/GameMarginController.class.php index 75b068bdf..b2b3ff063 100644 --- a/Application/Admin/Controller/GameMarginController.class.php +++ b/Application/Admin/Controller/GameMarginController.class.php @@ -184,7 +184,8 @@ class GameMarginController extends AdminController if($v["pc_pay_amount"] > 0){ $v["pc_ratio"] ="=ROUND(M{$line}/K{$line},2)"; - $v["pc_margin_amount"] = "=ROUND((K{$line}*(1-E{$line})*(1-F{$line}-H{$line}-L{$line})),2)"; + //K3*(1-(1-E3)*F3-L3) + $v["pc_margin_amount"] = "=ROUND((K{$line}*(1-(1-E{$line})*F{$line}-L{$line})),2)"; $v["pc_margin_ratio"] ="=ROUND(N{$line}/K{$line},3)"; } if ($v["pu_pay_amount"] > 0) { @@ -411,7 +412,8 @@ class GameMarginController extends AdminController if($v["pc_pay_amount"] > 0){ $v["pc_ratio"] ="=ROUND(M{$line}/K{$line},2)"; - $v["pc_margin_amount"] = "=ROUND((K{$line}*(1-E{$line})*(1-F{$line}-H{$line}-L{$line})),2)"; + //K3*(1-(1-E3)*F3-L3) + $v["pc_margin_amount"] = "=ROUND((K{$line}*(1-(1-E{$line})*F{$line}-L{$line})),2)"; $v["pc_margin_ratio"] ="=ROUND(N{$line}/K{$line},3)"; } if ($v["pu_pay_amount"] > 0) { @@ -551,7 +553,7 @@ class GameMarginController extends AdminController $item['cp_rebate_amount'] = $params['cp_rebate_amount']; $item['cp_other_amount'] = $params['cp_other_amount']; if($item["pc_pay_amount"] > 0){ - $item["pc_margin_amount"] = round($item["pc_pay_amount"]*(1-$item['cp_promote_ratio']/100)*(100-$item["cp_ratio"]-$item['cp_rebate_ratio']-$item["pc_ratio"])/100,2); + $item["pc_margin_amount"] = round($item["pc_pay_amount"]*(1-(100-$item['cp_promote_ratio'])/100*$item['cp_ratio']/100-$item['pc_ratio']/100),2); $item["pc_margin_ratio"] = round($item["pc_margin_amount"]/$item['pc_pay_amount'],4)*100; } if ($item["pu_pay_amount"] > 0) { @@ -643,15 +645,15 @@ class GameMarginController extends AdminController $item['cp_rebate_ratio'] = sprintf("%.0f%%",$item['cp_rebate_ratio']); } - $item['pc_ratio'] = sprintf("%.0f%%",$item['pc_ratio']); - $item['pu_ratio'] = sprintf("%.0f%%",$item['pu_ratio']); - $item['jh_ratio'] = sprintf("%.0f%%",$item['jh_ratio']); + $item['pc_ratio'] = sprintf("%.0f%%",round($item['pc_ratio'],0)); + $item['pu_ratio'] = sprintf("%.0f%%",round($item['pu_ratio'],0)); + $item['jh_ratio'] = sprintf("%.0f%%",round($item['jh_ratio'],0)); - $item['margin_ratio'] = sprintf("%.1f%%",$item['margin_ratio']); - $item['pu_margin_ratio'] = sprintf("%.1f%%",$item['pu_margin_ratio']); - $item['pc_margin_ratio'] = sprintf("%.1f%%",$item['pc_margin_ratio']); - $item['jh_margin_ratio'] = sprintf("%.1f%%",$item['jh_margin_ratio']); - $item['platform_margin_ratio'] = sprintf("%.1f%%",$item['platform_margin_ratio']); + $item['margin_ratio'] = sprintf("%.1f%%",round($item['margin_ratio'],1)); + $item['pu_margin_ratio'] = sprintf("%.1f%%",round($item['pu_margin_ratio'],1)); + $item['pc_margin_ratio'] = sprintf("%.1f%%",round($item['pc_margin_ratio'],1)); + $item['jh_margin_ratio'] = sprintf("%.1f%%",round($item['jh_margin_ratio'],1)); + $item['platform_margin_ratio'] = sprintf("%.1f%%",round($item['platform_margin_ratio'],1)); } diff --git a/Application/Admin/Controller/GameMarginSetController.class.php b/Application/Admin/Controller/GameMarginSetController.class.php index 96319cd4b..b7dbc78cb 100644 --- a/Application/Admin/Controller/GameMarginSetController.class.php +++ b/Application/Admin/Controller/GameMarginSetController.class.php @@ -496,10 +496,11 @@ class GameMarginSetController extends Controller { 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; - + //K3*(1-(1-E3)*F3-L3) if($v["pc_pay_amount"] > 0){ $v["pc_ratio"] = round($v["pc_statement_amount"]/$v['pc_pay_amount'],2)*100; - $v["pc_margin_amount"] = round($v["pc_pay_amount"]*(1-$v['cp_promote_ratio']/100)*(100-$v["cp_ratio"]-$v['cp_rebate_ratio']-$v["pc_ratio"])/100,2); + // $v["pc_margin_amount"] = round($v["pc_pay_amount"]*(1-$v['cp_promote_ratio']/100)*(100-$v["cp_ratio"]-$v['cp_rebate_ratio']-$v["pc_ratio"])/100,2); + $v["pc_margin_amount"] = round($v["pc_pay_amount"]*(1-(100-$v['cp_promote_ratio'])/100*$v['cp_ratio']/100-$v['pc_ratio']/100),2); $v["pc_margin_ratio"] = round($v["pc_margin_amount"]/$v['pc_pay_amount'],3)*100; } if ($v["pu_pay_amount"] > 0) { diff --git a/Application/Admin/View/GameMargin/marginView.html b/Application/Admin/View/GameMargin/marginView.html index 45c462bc1..2ad5372d0 100644 --- a/Application/Admin/View/GameMargin/marginView.html +++ b/Application/Admin/View/GameMargin/marginView.html @@ -334,7 +334,7 @@ }); function env(data) { - $("#cp_rebate_ratio").val(data.info.cp_rebate_ratio); + $("#cp_rebate_ratio").val(data.info.cp_rebate_ratio.replace("%",'')); $("#cp_rebate_amount").val(data.info.cp_rebate_amount); $("#cp_other_amount").val(data.info.cp_other_amount); $("#changeMargin").off("click");