From 9d89be45277eeca6bd73ab5244ddb07abebc3715 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 24 Dec 2019 15:29:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=AC=E5=8F=B8=E6=B8=B8?= =?UTF-8?q?=E6=88=8F=E5=90=8D=E6=B8=B8=E6=88=8F=E7=B1=BB=E5=9E=8B=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/function.php | 21 +++++++++++++ .../FinancePromoteController.class.php | 31 +++++++++---------- .../FinancePromote/gameStatisticsDetail.html | 15 +++++++++ 3 files changed, 51 insertions(+), 16 deletions(-) diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index f2e08137d..3664cde6a 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -560,6 +560,27 @@ function getGameByName($game_name=null, $sdk_version=null) return $result; } } +//根据游戏公司,游戏名称,游戏类型 +function getGameidByPartnerNameType($partner_id=null,$game_name=null, $sdk_version=null) +{ + $map = []; + if($partner_id){ + $map['partner_id'] = $partner_id; + } + if ($game_name) { + $map['relation_game_name'] = $game_name; + } + if ($sdk_version) { + $map['sdk_version'] = $sdk_version; + } + $result = D("Game")->field('id')->where($map)->select(); + if(empty($result)) { + return [['id' => -1]]; + }else + { + return $result; + } +} function getTopPromote($promote_id) { diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 8304524a3..27f5c6275 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -121,6 +121,7 @@ class FinancePromoteController extends AdminController } private function getJoinPromoteData($map,$istimeselect,$type="spend") { + setPowerPromoteIds($map,"s.promote_id"); if ($_REQUEST['promote_id'] != '') { if ($_REQUEST['promote_id'] == 0) { $map['s.promote_id'] = 0; @@ -276,6 +277,7 @@ class FinancePromoteController extends AdminController } private function promoteUserData($map,$istimeselect,$type="spend") { + setPowerPromoteIds($map,"s.promote_id"); if ($_REQUEST['promote_id'] != '') { if ($_REQUEST['promote_id'] == 0) { $map['s.promote_id'] = 0; @@ -436,14 +438,8 @@ class FinancePromoteController extends AdminController $map['pay_order_number'] = $_REQUEST['pay_order_number']; } - if (!empty(I('partner_id'))) { - $wherePartner = I('partner_id'); - $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); - $gameId = implode(',',array_column($gameId,'id')); - $map['game_id'] = ['in',$gameId]; - } - if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { - $map["game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); + if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) { + $map["game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); } if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -595,18 +591,21 @@ class FinancePromoteController extends AdminController $map['pay_order_number'] = $_REQUEST['pay_order_number']; } - if (!empty(I('partner_id'))&&empty(I("game_id"))) { - $wherePartner = I('partner_id'); - $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); - $gameId = implode(',',array_column($gameId,'id')); - $map['tab_spend.game_id'] = ['in',$gameId]; - } + // if (!empty(I('partner_id'))&&empty(I("game_id"))) { + // $wherePartner = I('partner_id'); + // $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); + // $gameId = implode(',',array_column($gameId,'id')); + // $map['tab_spend.game_id'] = ['in',$gameId]; + // } if (!empty(I("game_id"))) { $map['tab_spend.game_id'] = I("game_id"); } - if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { - $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); + if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) { + $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); } + // if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { + // $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); + // } if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { $map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]]; diff --git a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html index 10b206ca0..8efdb8698 100644 --- a/Application/Admin/View/FinancePromote/gameStatisticsDetail.html +++ b/Application/Admin/View/FinancePromote/gameStatisticsDetail.html @@ -325,12 +325,27 @@ $("#game_name").empty(); $("#game_name").append(str); $("#game_name").select2(); + // $("#game_type").empty(); } }) } + //设置设备类型 + function gameTypeInit() { + // var game_type = "{:I('game_type')}"; + var str = ""; + + $("#game_type").empty(); + $("#game_type").append(str); + $("#game_type").select2(); + } + var seleinit = 0; $("#partner_id").change(function(){ get_game_list(); + if(seleinit > 0){ + gameTypeInit(); + } + seleinit++; }); $("#partner_id").change();