修改分组名
@param array $group
@return bool
@throws \yii\web\HttpException
763412
public function updateGroup(array $group)
    {
        $result = $this->httpRaw(self::WECHAT_GROUP_UPDATE_PREFIX, [
            'group' => $group
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok';
    }
425290
public function clean($group = null)
	{
		$hash = $this->options['hash'];

		$allinfo = xcache_list(XC_TYPE_VAR, 0);

		foreach ($allinfo['cache_list'] as $key)
		{
			if (strpos($key['name'], $hash . '-cache-' . $group . '-') === 0) // xor $mode != 'group')
			{
				xcache_unset($key['name']);
			}
		}

		return true;
	}
962465
public function updateGroup(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_GROUP_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
113029
public function clearGroup($group)
    {
        $this->_File = null;

        $prefix = (string)$this->_config['prefix'];

        $directoryIterator = new RecursiveDirectoryIterator($this->_config['path']);
        $contents = new RecursiveIteratorIterator(
            $directoryIterator,
            RecursiveIteratorIterator::CHILD_FIRST
        );
        $filtered = new CallbackFilterIterator(
            $contents,
            function (SplFileInfo $current) use ($group, $prefix) {
                if (!$current->isFile()) {
                    return false;
                }

                $hasPrefix = $prefix === ''
                    || strpos($current->getBasename(), $prefix) === 0;
                if ($hasPrefix === false) {
                    return false;
                }

                $pos = strpos(
                    $current->getPathname(),
                    DIRECTORY_SEPARATOR . $group . DIRECTORY_SEPARATOR
                );

                return $pos !== false;
            }
        );
        foreach ($filtered as $object) {
            $path = $object->getPathname();
            $object = null;
            // @codingStandardsIgnoreLine
            @unlink($path);
        }

        return true;
    }
467046
public function removeGroup($group)
    {
        if (is_string($group)) {
            // If the group is a string, we'll assume the dev is passing
            // in a DN string of the group. We'll try to locate it.
            $group = $this->query->newInstance()->findByDn($group);
        }

        if ($group instanceof Group) {
            // If the group is Group model instance, we can
            // remove the current models DN from the group.
            return $group->removeMember($this->getDn());
        }

        return false;
    }
568889
public function getUserSummary(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_USER_SUMMARY_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['list']) ? $result['list'] : false;
    }
128729
public function deleteGroup($gid) {
		$group = WechatUserGroup::findOne($gid);
		if(!$group) {
			throw new ErrorException('数据查询失败');
		}

		$data = $this->getData('/cgi-bin/groups/delete', [
			'access_token' => $this->getAccessToken(),
		], Json::encode([
			'group' => ['id' => $group->gid],
		]));

		if(empty($data)) {
			return $group->delete();
		}

		return false;
	}
691717
public function isMemberOf($group)
    {
        if ($group == 'everyone') {
            return true;
        }

        return GroupMember::where('group', $group)
            ->where('user_id', $this->id())
            ->count() == 1;
    }
557050
public function addGroup($group) {
    if (!$group->inArray((array) $this->groups)) {
      $this->groups[] = $group;
      return $this->groups;
    }
    return true;
  }
492357
protected function executeActions($group)
    {
        $executedCount = 0;
        reset($this->actions[$group]);
        while (list($index, $action) = each($this->actions[$group])) {
            if ($this->isActionReadyToExecute($action[0], $action[2])) {
                $executedCount += $this->executeAction($index, $action);
                unset($this->actions[$group][$index]);
            }
        }

        return $executedCount;
    }
1368478
public function parse($group)
    {
        $this->setId($group['id']);
        $this->setName($group['name']);
        $this->setDescription($group['description']);
        $this->setType($group['type']);
        if (isset($group['primaryColour'])) {
            $this->setPrimaryColour($group['primaryColour']);
        }
        if (isset($group['secondaryColour'])) {
            $this->setSecondaryColour($group['secondaryColour']);
        }
        if (isset($group['badgeCode'])) {
            $this->setBadgeCode($group['badgeCode']);
        }
        if (isset($group['roomId'])) {
            $this->setRoomId($group['roomId']);
        }
        if (isset($group['isAdmin'])) {
            $this->setIsAdmin($group['isAdmin']);
        }
    }
745926
public function hasGroup(TagGroup $group)
    {
        foreach ($this->_groups as $knownGroup) {
            if ($knownGroup->getId() == $group->getId()) {
                return true;
            }
        }

        return false;
    }
861880
public function deletGroup($groupId)
    {
        $result = $this->httpRaw(self::WECHAT_GROUP_DELETE_PREFIX, [
            'group' => [
                'id' => $groupId
            ]
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok';
    }
723234
public function isAdminGroupActive(array $group, $adminCode = '')
    {
        $active = false;
        /** @var AdminInterface $admin */
        foreach ($group['items'] as $admin) {
            if ($admin->getCode() == $adminCode) {
                $active = true;
                break;
            }
        }

        return $active;
    }
182089
public function setGroup($group)
    {
        if (!empty($group)) {
            $this->query['group'] = $group;
        } else {
            unset($this->query['group']);
        }
        return $this;
    }
1032920
public function group($group, $context) {
		if (!$group) {
			return null;
		}
		$self = $this;
		$model = $context->model();
		$alias = $context->alias();

		$escaped = array_map(function($field) use ($self, $model, $alias) {
			if (!$model || !$model::schema($field)) {
				return $self->name($field);
			}
			return $self->name($alias) . '.' . $self->name($field);
		}, (array) $group);

		return 'GROUP BY ' .  join(', ', $escaped);
	}
1214680
public function withGroup($group)
    {
        $group = str_replace('\\', '/', $group);
        if (!isset(static::$instances[$group])) {
            $instance = new static($this->options);
            $instance->setGroup($group);
            static::$instances[$group] = $instance;
        }
        return static::$instances[$group];
    }