where($where)->where(['status' => 1])->select()->toArray(); $list = get_tree($department, 0, 2); $data['trees'] = $list; return json($data); } //获取子部门所有员工 public function get_employee($did = 0) { $did = get_params('did'); if($did == 1){ $department = $did; } else{ $department = get_department_son($did); } $employee = Db::name('admin') ->field('a.id,a.did,a.position_id,a.mobile,a.nickname,a.status,a.thumb,a.username,d.title as department') ->alias('a') ->join('Department d', 'a.did = d.id') ->where(['a.status' => 1]) ->where('a.id', ">", 1) ->where('a.did', "in", $department) ->select(); // halt($employee); return to_assign(0, '', $employee); } }