From 9e2eb469044c6cece09c423488456f82aaac2e13 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 6 Jan 2020 13:44:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=BB=9F=E8=AE=A1=E6=96=B0=E5=A2=9E=E5=A4=9A?= =?UTF-8?q?=E9=87=8D=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancePromoteController.class.php | 55 +++++++++++++++++-- .../View/FinancePromote/gameStatistics.html | 5 +- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index e455f2eae..0deb25a66 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -45,7 +45,6 @@ class FinancePromoteController extends AdminController $senddata[$v['p_id']] = $v; } -// dump($cash);die(); //内冲 $inside = self::getJoinPromoteData([],$istimeselect,"promote_coin"); foreach($inside as $k=>$v){ @@ -109,7 +108,6 @@ class FinancePromoteController extends AdminController "bind_coin_count"=>0, "inside_cash_count"=>0, ); -// dump($senddata);die(); foreach($senddata as $k=>$v){ if ($v['company_belong']==1) { $v['company_belong']='外团'; @@ -152,7 +150,6 @@ class FinancePromoteController extends AdminController $outBelong = 0; $insideBelong = 0; -// dump($data);die(); foreach ($data as $key => $value) { if ($value['company_belong']=='外团') { @@ -174,7 +171,6 @@ class FinancePromoteController extends AdminController $this->assign('all_count', $count); $this->meta_title = '公会统计'; $this->display(); - # code... } private function getJoinPromoteData($map,$istimeselect,$type="spend") { @@ -413,7 +409,7 @@ class FinancePromoteController extends AdminController $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 $row = $_REQUEST['row'] ?? 10; - + $title = ''; $map = []; if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { $map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); @@ -429,6 +425,49 @@ class FinancePromoteController extends AdminController } elseif (isset($_REQUEST['time_end'])) { $map['s.pay_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399]; } + //公司判断 + $pmap = false; //非特意推广员检索 + $gfflg = true; //是否有官方 + if (isset($_REQUEST['company_id'])) { + $pmap['company_id'] = $_REQUEST['company_id']; + //获取公司名称 + if($pmap['company_id'] == 0){ + $title .= "万盟天下科技-"; + }else{ + $gfflg = false; + $title .= (M('promote_company',"tab_")->field("company_name")->where("id = '{$pmap['company_id']}'")->find()['company_name'] . "-"); + } + + } + if (isset($_REQUEST['company_belong'])) { + $pmap['company_belong'] = $_REQUEST['company_belong']; + if($_REQUEST['company_belong'] == 0){ + $title .= "内团-"; + }else{ + $gfflg = false; + $title .= "外团-"; + } + } + if (isset($_REQUEST['promote_id'])) { + $pmap = false; //取消非特异推广员检索 + $title .= (get_promote_name($_REQUEST['promote_id'])."-"); + if ($_REQUEST['promote_id'] != 0){ + $gfflg = false; + } + } + + if($pmap){ + $promoter_ids = D("Promote")->where($pmap)->field('id')->select(); + if ($promoter_ids) { + if($gfflg){ + $t_in = "0,".implode(',', array_column($promoter_ids, 'id')); + }else{ + $t_in = implode(',', array_column($promoter_ids, 'id')); + } + $map['s.promote_id'] = ['in',$t_in]; + } + } + //判断是否有推广员 $level = 1; if ($_REQUEST['promote_id'] != '') { @@ -438,13 +477,17 @@ class FinancePromoteController extends AdminController if ($_REQUEST['promote_id'] == 0 || $_REQUEST['promote_type'] == 2) { $map['s.promote_id'] = $_REQUEST['promote_id']; } else { + //判断收有公司 $promoter_ids = D("Promote")->where("chain like '%/{$_REQUEST['promote_id']}/%' or id={$_REQUEST['promote_id']}")->field('id')->select(); if ($promoter_ids) { $map['s.promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))]; } } } - $this->assign('promote_level', $level); + $title .= "游戏统计"; + $this->assign('title', $title); + + //游戏统计列表 $data =self::gameStatisticsData($map, $row, $p); diff --git a/Application/Admin/View/FinancePromote/gameStatistics.html b/Application/Admin/View/FinancePromote/gameStatistics.html index 3ae3429f6..1840019b3 100644 --- a/Application/Admin/View/FinancePromote/gameStatistics.html +++ b/Application/Admin/View/FinancePromote/gameStatistics.html @@ -72,10 +72,7 @@