From 6d3b5f05b48265bc4e7071ded58c3460bbe76815 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 19 May 2021 18:30:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=AF=94=E4=BE=8B=E4=BD=93=E7=B3=BB?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/CompanySystemRatioController.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/CompanySystemRatioController.class.php b/Application/Admin/Controller/CompanySystemRatioController.class.php index e5102d330..8e4b947bf 100644 --- a/Application/Admin/Controller/CompanySystemRatioController.class.php +++ b/Application/Admin/Controller/CompanySystemRatioController.class.php @@ -191,13 +191,16 @@ class CompanySystemRatioController extends AdminController //将比例整合 function handleRatio($handleData = []) { $finalData = []; - +// dump($handleData);die(); foreach ($handleData as $key => $value) { foreach ($value as $vk => $vv) { foreach ($vv as $k => $v) { if ($finalData[$key][$v['turnover']]) { $finalData[$key][$v['turnover']][$vk] = $v["ratio"]; +// if($v["instanceof"] != 0 && ($vk==0||$vk==1||$vk==2) && $handleData[$key][$vk][$k-1]["ratio"]) { +// $finalData[$key][$v['turnover']][$vk] = $handleData[$key][$vk][$k-1]["ratio"]; +// } //判断是否有相同值且一个是>=另一个是>的情况 if ($finalData[$key][$v['turnover']]["instanceof"] != $v["instanceof"]) { $finalData[$key][$v['turnover']]["instanceof"] = 0; @@ -224,7 +227,7 @@ class CompanySystemRatioController extends AdminController } -// dump($finalData); +// dump($finalData);die(); $data = []; foreach ($finalData as $key => $value) { From 54b9373b2bd72f97576183142dbbf3b425a07e74 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Wed, 19 May 2021 20:12:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=AF=94=E4=BE=8B=E4=BD=93=E7=B3=BB?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanySystemRatioController.class.php | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/CompanySystemRatioController.class.php b/Application/Admin/Controller/CompanySystemRatioController.class.php index 8e4b947bf..f1c273a0c 100644 --- a/Application/Admin/Controller/CompanySystemRatioController.class.php +++ b/Application/Admin/Controller/CompanySystemRatioController.class.php @@ -44,6 +44,8 @@ class CompanySystemRatioController extends AdminController $handleData = $this->getCpGameRatio($handleData); $data = $this->handleRatio($handleData); + $checkData = $handleData; + // dump($data);die(); $gameData = M("game","tab_")->field("original_package_name,relation_game_name game_name,game_type_name,relation_game_id game_id") @@ -131,8 +133,43 @@ class CompanySystemRatioController extends AdminController ('<'). ($end); } else { - $data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk]['turnover']= - '月流水='.$vvv['turnover']; + + if ($vvv['instanceof'] != 1) { + foreach ($this->checkRatio as $ck => $cv) { +// if($v['game_id'] == 187) { +// +// dump($checkData[$v['game_id']][$cv]); +// dump($vvv); +// } + foreach ($checkData[$v['game_id']][$cv] as $gk=> $gv){ +// if($cv == 2){ +// dump($gv); +// dump($vvv['turnover']); +// die(); + if($gv['turnover'] < $vvv['turnover']) { + $checkInstanceof = array_column($checkData[$v['game_id']][$cv],'instanceof'); +// if($v['game_id'] == 187 && $cv == 2) { +// dump($checkData[$v['game_id']][$cv]); +// dump($vvv['turnover']); +// dump(in_array(3,$checkInstanceof)); +// } +// in_array($checkInstanceof,2); + +// die(); + if (in_array(2,$checkInstanceof)) { + $data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk][$cv] = $gv['ratio']; + } + } else { + break; + } +// } + + } + } + } + + $data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk]['turnover']= + '月流水='.$vvv['turnover']; } } @@ -142,6 +179,7 @@ class CompanySystemRatioController extends AdminController } } } +// die(); if ($_REQUEST['export']) { $this->assign("is_export",true);