From 437909d53a922370beed4091b34203547048baa1 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 24 Oct 2019 19:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/RechargeSumController.class.php | 13 ++++++++++--- .../Admin/Controller/SpendController.class.php | 6 +++++- .../Admin/Controller/UserController.class.php | 10 ++++++++-- Application/Admin/View/Member/user_info.html | 2 +- Application/Admin/View/RechargeSum/summation.html | 2 +- Application/Admin/View/Spend/lists.html | 2 +- Application/Admin/View/User/rolelist.html | 8 +++++--- 7 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Application/Admin/Controller/RechargeSumController.class.php b/Application/Admin/Controller/RechargeSumController.class.php index 84eec8aa7..8bd895682 100644 --- a/Application/Admin/Controller/RechargeSumController.class.php +++ b/Application/Admin/Controller/RechargeSumController.class.php @@ -44,7 +44,7 @@ class RechargeSumController extends ThinkController{ $map['pay_way'] = array('egt',0); } - if(!empty($_REQUEST['promote_id'])){ + if(isset($_REQUEST['promote_id'])){ // switch ($_REQUEST['promote_id']) { // case 'GUANFANG': // $map['promote_id'] = 0; @@ -59,8 +59,12 @@ class RechargeSumController extends ThinkController{ // $rmap['promote_id'] = $_REQUEST['promote_id']; // break; // } - $promoter_ids = D("Promote")->where("parent_id={$_REQUEST['promote_id']} or grand_id={$_REQUEST['promote_id']} or id={$_REQUEST['promote_id']}")->field('id')->select(); - $promoter_ids ? $rmap['promote_id'] = $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; + if ($_REQUEST['promote_id'] > 0) { + $promoter_ids = D("Promote")->where("parent_id={$_REQUEST['promote_id']} or grand_id={$_REQUEST['promote_id']} or id={$_REQUEST['promote_id']}")->field('id')->select(); + $promoter_ids ? $rmap['promote_id'] = $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; + } else { + $rmap['promote_id'] = $map['promote_id'] = 0; + } } //当天注册人数 @@ -88,6 +92,9 @@ class RechargeSumController extends ThinkController{ case 'GUANFANG': $data[$key]['promote_id'] = "官方渠道"; break; + case 0: + $data[$key]['promote_id'] = "官方渠道"; + break; case 'PROMOTE': $data[$key]['promote_id'] = "推广渠道"; break; diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index c58167a3b..688a73315 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -71,7 +71,11 @@ class SpendController extends ThinkController { unset($_REQUEST['pay_game_status']); } if(isset($_REQUEST['promote_id'])) { - $map['_complex'] = ['tp.parent_id'=>$_REQUEST['promote_id'], 'tp.grand_id'=>$_REQUEST['promote_id'], 'tp.id'=>$_REQUEST['promote_id'], '_logic' => 'or']; + if ($_REQUEST['promote_id'] == 0) { + $map['promote_id'] = 0; + } else { + $map['_complex'] = ['tp.parent_id'=>$_REQUEST['promote_id'], 'tp.grand_id'=>$_REQUEST['promote_id'], 'tp.id'=>$_REQUEST['promote_id'], '_logic' => 'or']; + } $tab_promote_join = "left join tab_promote as tp on tp.id = tab_spend.promote_id"; //unset($_REQUEST['promote_id']); } else { diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index aec80c71f..c95dec0b5 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -570,8 +570,14 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ unset($_REQUEST['role_name']); } if (isset($_REQUEST['promote_id'])) { - $promoter_ids = D("Promote")->where("parent_id={$_REQUEST['promote_id']} or grand_id={$_REQUEST['promote_id']} or id={$_REQUEST['promote_id']}")->field('id')->select(); - $promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; + $queryStr = ''; + if ($_REQUEST['promote_id'] == 0) { + $map['promote_id'] = '0'; + } else { + $queryStr = "parent_id={$_REQUEST['promote_id']} or grand_id={$_REQUEST['promote_id']} or id={$_REQUEST['promote_id']}"; + $promoter_ids = D("Promote")->where($queryStr)->field('id')->select(); + $promoter_ids ? $map['promote_id'] = ['in', implode(',', array_column($promoter_ids, 'id'))] : null; + } } empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"]; diff --git a/Application/Admin/View/Member/user_info.html b/Application/Admin/View/Member/user_info.html index 5bb75a9ad..a44d286fe 100644 --- a/Application/Admin/View/Member/user_info.html +++ b/Application/Admin/View/Member/user_info.html @@ -406,7 +406,7 @@ $(function(){ data:{level:$("#promote_level option:selected").val()}, dataType:'json', success:function(response){ - str = ''; + str = ''; // $.each(response.data, function(index, item){ // console.log(item.id); // str += ''; diff --git a/Application/Admin/View/RechargeSum/summation.html b/Application/Admin/View/RechargeSum/summation.html index 51ee0b684..585758b64 100644 --- a/Application/Admin/View/RechargeSum/summation.html +++ b/Application/Admin/View/RechargeSum/summation.html @@ -292,7 +292,7 @@ $(function(){ data:{level:$("#promote_level option:selected").val()}, dataType:'json', success:function(response){ - str = ""; + str = ''; // $.each(response.data, function(index, item){ // console.log(item.id); // str += ''; diff --git a/Application/Admin/View/Spend/lists.html b/Application/Admin/View/Spend/lists.html index b160f7f19..5de823dd5 100644 --- a/Application/Admin/View/Spend/lists.html +++ b/Application/Admin/View/Spend/lists.html @@ -487,7 +487,7 @@ data:{level:$("#promote_level option:selected").val()}, dataType:'json', success:function(response){ - str = ""; + str = ''; // $.each(response.data, function(index, item){ // console.log(item.id); // str += ''; diff --git a/Application/Admin/View/User/rolelist.html b/Application/Admin/View/User/rolelist.html index b5b65bc90..896e1ff41 100644 --- a/Application/Admin/View/User/rolelist.html +++ b/Application/Admin/View/User/rolelist.html @@ -101,7 +101,8 @@