From 8633efd7d6d2e20a4b2572849026fe16127972e3 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 1 Nov 2019 13:39:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8=E9=95=BF?= =?UTF-8?q?=E5=88=86=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 109 ++++++++++-------- .../Home/View/default/Query/recharge.html | 37 +----- .../Home/View/default/Query/register.html | 41 +------ 3 files changed, 70 insertions(+), 117 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 1fd6cddc8..006d2039b 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -46,45 +46,48 @@ class QueryController extends BaseController // $map['tab_spend.promote_id'] = ['in', $childPromoteIds]; // } - - $map1['chain'] = ['like', '%' . PID . '/' . '%']; - $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); + + $map1['chain'] = ['like','%'.PID.'/'.'%']; + $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; - if (empty($rs)) { + if(empty($rs)) { $map['tab_spend.promote_id'] = PID; - } else { - foreach ($rs as $rsKey => $rsValue) { + }else { + foreach ($rs as $rsKey => $rsValue) { $id = $rsValue['id']; - $childPromoteIds .= $id . ','; + $childPromoteIds .= $id.','; } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_spend.promote_id'] = ['in', $childPromoteIds]; + $childPromoteIds = rtrim($childPromoteIds, ','); + $childPromoteIds .= ',' . PID; + $map['tab_spend.promote_id'] = ['in', $childPromoteIds]; } - $levelPromote = I('level_promote', []); - $promote = $this->getLoginPromote(); + $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - $map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; + $map2[] = [ + '_logic' => 'or', + 'id' => $queryPromote['id'], + 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] + ]; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); - if (empty($ids)) { - $ids = array(); + if(empty($ids)) { + $ids = array(); } - if (empty($levelPromote)) { - array_push($ids, PID); - + if(empty($levelPromote)) { + array_push($ids,PID); + } - array_push($ids, $queryPromote['id']); + array_push($ids,$queryPromote['id']); if (!empty($ids)) { - $map['tab_spend.promote_id'] = ['in', $ids]; - - } else { + $map['tab_spend.promote_id'] = ['in',$ids]; + + }else { $map['_string'] = '1<>1'; } - + if (!empty(I('own_id'))) { - $map['tab_spend.promote_id'] = $promote['id'];//本账号 + $map['tab_spend.promote_id'] = $queryPromote['id'];//本账号 } if (!empty(I('begtime')) && empty(I('endtime'))) { @@ -157,6 +160,9 @@ class QueryController extends BaseController empty(I('own_id')) || $parameter['own_id'] = I('own_id'); empty(I('begtime')) || $parameter['begtime'] = I('begtime'); empty(I('endtime')) || $parameter['endtime'] = I('endtime'); + empty(I('level_promote_2')) || $parameter['level_promote_2'] = I('level_promote_2'); + empty(I('level_promote_3')) || $parameter['level_promote_3'] = I('level_promote_3'); + empty(I('level_promote_4')) || $parameter['level_promote_4'] = I('level_promote_4'); !isset($_REQUEST['pay_way']) || $parameter['pay_way'] = I('pay_way'); $serverData = $this->getServer(I('relation_game_id'), I('sdk_version')); @@ -192,6 +198,7 @@ class QueryController extends BaseController } else { $row = 10; } + //$childPromoteIds = getAllChildPromoteList(3); // if (empty($childPromoteIds)) { @@ -201,44 +208,48 @@ class QueryController extends BaseController // // $map['tab_user.promote_id'] = ['in', $childPromoteIds]; // } - // $map['tab_user.promote_id'] = ['like','%'.PID.'/'.'%']; - $map1['chain'] = ['like', '%' . PID . '/' . '%']; - $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); + // $map['tab_user.promote_id'] = ['like','%'.PID.'/'.'%']; + $map1['chain'] = ['like','%'.PID.'/'.'%']; + $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; - if (empty($rs)) { + if(empty($rs)) { $map['tab_user.promote_id'] = PID; - } else { - foreach ($rs as $rsKey => $rsValue) { + }else { + foreach ($rs as $rsKey => $rsValue) { $id = $rsValue['id']; - $childPromoteIds .= $id . ','; + $childPromoteIds .= $id.','; } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_user.promote_id'] = ['in', $childPromoteIds]; + $childPromoteIds = rtrim($childPromoteIds, ','); + $childPromoteIds .= ',' . PID; + $map['tab_user.promote_id'] = ['in', $childPromoteIds]; } - $levelPromote = I('level_promote', []); $promote = $this->getLoginPromote(); + $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - $map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; + $map2[] = [ + '_logic' => 'or', + 'id' => $queryPromote['id'], + 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] + ]; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); - if (empty($ids)) { - $ids = array(); + if(empty($ids)) { + $ids = array(); } - if (empty($levelPromote)) { - array_push($ids, PID); - + if(empty($levelPromote)) { + array_push($ids,PID); + } - array_push($ids, $queryPromote['id']); + array_push($ids,$queryPromote['id']); if (!empty($ids)) { - $map['tab_user.promote_id'] = ['in', $ids]; - - } else { + $map['tab_user.promote_id'] = ['in',$ids]; + + }else { $map['_string'] = '1<>1'; } - + if (!empty(I('own_id'))) { - $map['tab_user.promote_id'] = $promote['id'];//本账号 + $map['tab_user.promote_id'] = $queryPromote['id'];//本账号 } if (!empty(I('begtime')) && empty(I('endtime'))) { @@ -288,7 +299,9 @@ class QueryController extends BaseController empty(I('account')) || $parameter['account'] = I('account'); empty(I('begtime')) || $parameter['begtime'] = I('begtime'); empty(I('endtime')) || $parameter['endtime'] = I('endtime'); - + empty(I('level_promote_2')) || $parameter['level_promote_2'] = I('level_promote_2'); + empty(I('level_promote_3')) || $parameter['level_promote_3'] = I('level_promote_3'); + empty(I('level_promote_4')) || $parameter['level_promote_4'] = I('level_promote_4'); $thisParentPromoteId = getParentPromoteId(PID);//本账号上级渠道ID $page = set_pagination($count, $row, $parameter); if ($page) { diff --git a/Application/Home/View/default/Query/recharge.html b/Application/Home/View/default/Query/recharge.html index aaed2cbbb..52710917e 100644 --- a/Application/Home/View/default/Query/recharge.html +++ b/Application/Home/View/default/Query/recharge.html @@ -63,55 +63,24 @@