作者 郭静帆
1 个管道 的构建 通过 耗费 5 秒

公众号

@@ -1598,22 +1598,22 @@ class User extends Api @@ -1598,22 +1598,22 @@ class User extends Api
1598 $is_work = $this->request->param('is_work'); //是否在职:0=否,1=是 1598 $is_work = $this->request->param('is_work'); //是否在职:0=否,1=是
1599 $keyword = $this->request->param('keyword'); 1599 $keyword = $this->request->param('keyword');
1600 $where['pid'] = $user['id']; //下一级 1600 $where['pid'] = $user['id']; //下一级
1601 -// if ($user['lower_num'] == 1){  
1602 -// $where['pid'] = $user['id']; //下一级  
1603 -// }  
1604 -// if ($user['lower_num'] == 2){  
1605 -// // 下二级  
1606 -// $xia_ids = $this->model  
1607 -// ->where('pid',$user['id'])  
1608 -// ->column('id');  
1609 -// if(!empty($xia_ids)){  
1610 -// $xia_xia_ids = $this->model  
1611 -// ->where('pid','in',$xia_ids)  
1612 -// ->column('id');  
1613 -// $xia_ids = $xia_xia_ids ? array_merge($xia_ids,$xia_xia_ids) : $xia_ids;  
1614 -// }  
1615 -// $where['id'] = $xia_ids ? ['in',$xia_ids] : 0;  
1616 -// } 1601 + if ($user['lower_num'] == 1){
  1602 + $where['pid'] = $user['id']; //下一级
  1603 + }
  1604 + if ($user['lower_num'] == 2){
  1605 + // 下二级
  1606 + $xia_ids = $this->model
  1607 + ->where('pid',$user['id'])
  1608 + ->column('id');
  1609 + if(!empty($xia_ids)){
  1610 + $xia_xia_ids = $this->model
  1611 + ->where('pid','in',$xia_ids)
  1612 + ->column('id');
  1613 + $xia_ids = $xia_xia_ids ? array_merge($xia_ids,$xia_xia_ids) : $xia_ids;
  1614 + }
  1615 + $where['id'] = $xia_ids ? ['in',$xia_ids] : 0;
  1616 + }
1617 1617
1618 if($is_work != ''){ 1618 if($is_work != ''){
1619 $where['is_work'] = $is_work; 1619 $where['is_work'] = $is_work;