Get simple user list.

@param int  $departmentId
@param bool $fetchChild

@return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string
433993
public function getDepartmentUsers(int $departmentId, bool $fetchChild = false)
    {
        $params = [
            'department_id' => $departmentId,
            'fetch_child' => (int) $fetchChild,
        ];

        return $this->httpGet('cgi-bin/user/simplelist', $params);
    }
811570
def get(self, id=None):
        
        if id is None:
            res = self._get('department/list')
        else:
            res = self._get('department/list', params={'id': id})
        return res['department']
1051042
public function getSubs($id)
	{
		$target = Member::find($id);

		$department_ids = $this->getSubDepartments($target->department);
		$position_ids = $this->getSubPositions($target->position);
		
		$recs = Member::whereIn('department', $department_ids)
		              ->whereIn('position', $position_ids)
		              ->where('id', '>', 1)
		              ->where('state', 0)
              		  ->where('new', 1)
		              ->where('private', 1)
		              ->where('show', 0)
		              ->get();

		$arr = [];             
		if(count($recs)){
			foreach ($recs as $rec) {
				$arr[] = $rec->work_id;
			}
			return $arr;
		}

	}
953173
public function get($userId)
    {
        $endpoint = '/admin/users/'.$userId.'.json';
        $response = $this->request($endpoint);
        return $this->createObject(User::class, $response['user']);
    }
181552
public static function get_children_of_user($userid) {
        global $DB;

        // Get users that the user has role assignments to.
        $allusernames = get_all_user_name_fields(true, 'u');
        $sql = "SELECT u.id, $allusernames
                  FROM {role_assignments} ra, {context} c, {user} u
                 WHERE ra.userid = :userid
                       AND ra.contextid = c.id
                       AND c.instanceid = u.id
                       AND c.contextlevel = :contextlevel";
        $params = [
            'userid' => $userid,
            'contextlevel' => CONTEXT_USER
        ];

        // The final list of users that we will return.
        $finalresults = [];

        // Our prospective list of users.
        if ($candidates = $DB->get_records_sql($sql, $params)) {
            foreach ($candidates as $key => $child) {
                $childcontext = \context_user::instance($child->id);
                if (has_capability('tool/dataprivacy:makedatarequestsforchildren', $childcontext, $userid)) {
                    $finalresults[$key] = $child;
                }
            }
        }
        return $finalresults;
    }
462815
public function getDepartments($departmentId)
    {
        $apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/department/list';

        $result = $this->_curl($apiUrl, [
            'access_token' => $this->getAccessToken(),
            'id' => $departmentId,
        ]);

        return ($result and isset($result['department'])) ? $result['department'] : null;
    }
85440
public function lists($id = 0)
    {
        $response = $this->http->get(self::API_GET.'?id='.$id);

        return $response['department'];
    }
1246722
protected function fetchUserId($fieldId)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query
            ->select(
                $this->dbHandler->quoteColumn('contentobject_id')
            )
            ->from($this->dbHandler->quoteTable('ezcontentobject_attribute'))
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('id', 'ezcontentobject_attribute'),
                    $query->bindValue($fieldId)
                )
            );

        $stmt = $query->prepare();
        $stmt->execute();

        return $stmt->fetchColumn();
    }
703285
private function getNode($fetchDepth)
    {
        if (null === $this->node) {
            $path = $this->dm->getUnitOfWork()->getDocumentId($this->document);
            $this->node = $this->dm->getPhpcrSession()->getNode($path, $fetchDepth);
        }

        return $this->node;
    }
1014224
public function getChildren($parentID)
    {
        $tmp = [];
        foreach($this->categoryList as $key => $item){
            if($item->parentID == $parentID) {
                $tmp[] = $item;
            }
        }

        return $tmp;
    }
1034003
public function getDepartmentList($id = null)
    {
        $result = $this->httpGet(self::WECHAT_DEPARTMENT_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
        ] + ($id === null ? [] : [
            'id' => $id
        ]));
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result['department'] : false;
    }
812272
public function show($id)
    {
        // get user by id
        $user = AppUser::find($id);

        if (!$user) {
            return response()->json(null, 404);
        }

        return response()->json(arrayView('phpsoft.users::user/read', [
            'user' => $user
        ]), 200);
    }
969918
public function lists($departmentId, $fetchChild = 1, $status = 1)
    {
        $params = array(
                    'department_id'     => $departmentId,
                    'fetch_child'       => $fetchChild,
                    'status'            => $status,
                );

        return new Bag($this->http->get(self::API_LIST, $params));
    }
24740
public function getChilds($id)
    {
        $result = [];
        if (array_key_exists($id, $this->finder)) {
            return $this->recursiveGetChilds($this->finder[$id][$this->config['childs']], $result);
        } else {
            return $result;
        }
    }
266310
public function fetchById($id) {
        $select = $this->select()->where('id = ?', $id);
        return $this->fetchRow($select);
    }
668415
static function fetchIDListByUser( $idArray )
    {
        $db = eZDB::instance();

        $groupINSQL = $db->generateSQLINStatement( $idArray, 'ezuser_role.contentobject_id', false, false, 'int' );
        $query = "SELECT DISTINCT ezrole.id AS id
                  FROM ezrole,
                       ezuser_role
                  WHERE $groupINSQL AND
                        ezuser_role.role_id = ezrole.id ORDER BY ezrole.id";

        $retArray = array();
        foreach( $db->arrayQuery( $query ) as $resultSet )
        {
            $retArray[] = $resultSet['id'];
        }
        return $retArray;
    }
416339
public function getQuestionList($language, $surveyId, $sourceSurveyId = null)
    {
        $survey = $this->getSurvey($surveyId, $sourceSurveyId);
        $model  = $survey->getModel();
        $result = [];

        foreach($model->getItemsOrdered() as $name) {
            if ($label = $model->get($name, 'label')) {
                $result[$name] = $label;
            }
        }

        if ($model->getMeta('nested', false)) {
            foreach ($model->getMeta('nestedNames') as $name) {
                // We have a nested model, add the nested questions
                $nestedModel = $model->get($name, 'model');
                foreach($nestedModel->getItemsOrdered() as $name) {
                    if ($label = $nestedModel->get($name, 'label')) {
                        $result[$name] = $label;
                    }
                }
            }
        }

        return $result;
    }