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

公众号

... ... @@ -1598,22 +1598,22 @@ class User extends Api
$is_work = $this->request->param('is_work'); //是否在职:0=否,1=是
$keyword = $this->request->param('keyword');
$where['pid'] = $user['id']; //下一级
// if ($user['lower_num'] == 1){
// $where['pid'] = $user['id']; //下一级
// }
// if ($user['lower_num'] == 2){
// // 下二级
// $xia_ids = $this->model
// ->where('pid',$user['id'])
// ->column('id');
// if(!empty($xia_ids)){
// $xia_xia_ids = $this->model
// ->where('pid','in',$xia_ids)
// ->column('id');
// $xia_ids = $xia_xia_ids ? array_merge($xia_ids,$xia_xia_ids) : $xia_ids;
// }
// $where['id'] = $xia_ids ? ['in',$xia_ids] : 0;
// }
if ($user['lower_num'] == 1){
$where['pid'] = $user['id']; //下一级
}
if ($user['lower_num'] == 2){
// 下二级
$xia_ids = $this->model
->where('pid',$user['id'])
->column('id');
if(!empty($xia_ids)){
$xia_xia_ids = $this->model
->where('pid','in',$xia_ids)
->column('id');
$xia_ids = $xia_xia_ids ? array_merge($xia_ids,$xia_xia_ids) : $xia_ids;
}
$where['id'] = $xia_ids ? ['in',$xia_ids] : 0;
}
if($is_work != ''){
$where['is_work'] = $is_work;
... ...