From 3d1ab701234c5bd93d7196c3a1a28375a1131d38 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 26 Nov 2020 09:21:53 +0800 Subject: [PATCH] =?UTF-8?q?11=E6=9C=88=E5=8A=9F=E8=83=BD=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/TimingController.class.php | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/TimingController.class.php b/Application/Admin/Controller/TimingController.class.php index 47ed9fe75..de080719f 100644 --- a/Application/Admin/Controller/TimingController.class.php +++ b/Application/Admin/Controller/TimingController.class.php @@ -771,7 +771,29 @@ class TimingController extends AdminController { $return = []; foreach ($data as $key => $value) { - $statement_info = json_decode($value['statement_info'],true); + $info = []; + $pool_data = M("company_statement_pool","tab_") + ->field("id") + ->where("(statement_begin_time <={$end_time} AND ( statement_end_time = 0 OR statement_end_time >= {$start_time})) and withdraw_type=3 and statement_ids like '%{$value['id']}%'") + ->select(); + foreach ($pool_data as $pk => $pv) { + $info = M("company_statement_info","tab_") + ->field("statement_info") + ->where("(statement_begin_time <={$end_time} AND ( statement_end_time = 0 OR statement_end_time >= {$start_time})) and withdraw_type=3 and pool_id = {$pv['id']} and company_id = {$value['company_id']}") + ->find()['statement_info']; + + if ($info) { + break; + } + + } + + if ($info) { + $statement_info = json_decode($info,true); + } else { + $statement_info = json_decode($value['statement_info'],true); + } + $is_inside = M("PromoteCompany","tab_")->field("is_inside")->where("id='{$value['company_id']}'")->find()['is_inside']; if ($value['company_type'] == 2) { @@ -787,7 +809,7 @@ class TimingController extends AdminController { continue; } // - if (isset($return[$statement_info['promote_id'].$v['relation_game_id']])) { + if (isset($return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']])) { $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] = !$is_inside?$v['sum_money']:0; } else { $return[$value['company_id']."-".$sval['promote_id']."-".$v['relation_game_id']] += !$is_inside?$v['sum_money']:0; @@ -834,14 +856,14 @@ class TimingController extends AdminController { } } - +// dump($return); return $return; } public function test() { -// $this->getSpecialComplement(strtotime(date("Y-m-1",strtotime("2020-07"))),strtotime(date("Y-m-t",strtotime("2020-07")))+86399,2259); - dump(D("CompanyGameRatio")->getPromoteCompanyGameRatio(18,(string)207,1600099200,1603728000,1)); + $this->getSpecialComplement(strtotime(date("Y-m-1",strtotime("2020-08"))),strtotime(date("Y-m-t",strtotime("2020-08")))+86399,2259); +// dump(D("CompanyGameRatio")->getPromoteCompanyGameRatio(18,(string)207,1600099200,1603728000,1)); // $this->createMarketBonus("all"); }