From 5fe238ccbd98779fc6b6ba621d819a69b5de15be Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Tue, 11 Feb 2020 15:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=A0=E9=81=93=E6=B5=81=E6=B0=B4=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/QueryController.class.php | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index a5d09a711..f3a07b3ff 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1593,24 +1593,23 @@ class QueryController extends ThinkController $promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find(); $level = $promoteInfo['level']; if($promote_id != 0) { + $promoteIdArr = []; if ($level == 1) { $rootPromoteId = $promote_id; - $where['promote_id'] = $promote_id; + $promoteIdArr[] = $promote_id; }else { $chain = $promoteInfo['chain']; $chainArr = explode('/',$chain); $rootPromoteId = $chainArr[1]; - $where1['chain'] = array('like', '%/' . $rootPromoteId. '/%'); - $promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select(); - $promoteIdArr = []; - foreach($promoteIdInfo as $key2 => $v1) { - $promoteIdArr[] = $v1['id']; - } - $where['promote_id'] = ['in',$promoteIdArr]; } - + $where1['chain'] = array('like', '%/' . $rootPromoteId. '/%'); + $promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select(); + foreach($promoteIdInfo as $key2 => $v1) { + $promoteIdArr[] = $v1['id']; + } + $map['promote_id'] = ['in',$promoteIdArr]; }else { - $where['promote_id'] = 0; + $map['promote_id'] = 0; } @@ -1911,25 +1910,25 @@ class QueryController extends ThinkController $promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find(); $level = $promoteInfo['level']; if($promote_id != 0) { + $promoteIdArr = []; if ($level == 1) { $rootPromoteId = $promote_id; - $map['promote_id'] = $promote_id; + $promoteIdArr[] = $promote_id; }else { $chain = $promoteInfo['chain']; $chainArr = explode('/',$chain); $rootPromoteId = $chainArr[1]; - $where1['chain'] = array('like', '%/' . $rootPromoteId. '/%'); - $promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select(); - $promoteIdArr = []; - foreach($promoteIdInfo as $key2 => $v1) { - $promoteIdArr[] = $v1['id']; - } - $map['promote_id'] = ['in',$promoteIdArr]; } - + $where1['chain'] = array('like', '%/' . $rootPromoteId. '/%'); + $promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select(); + foreach($promoteIdInfo as $key2 => $v1) { + $promoteIdArr[] = $v1['id']; + } + $map['promote_id'] = ['in',$promoteIdArr]; }else { $map['promote_id'] = 0; } + var_dump($level); $pay_status = 1; $map['game_id'] = ['in',$gameNameIdArr]; // $map['promote_id'] = ['in',$promoteIdArr];