获取菜单列表
@param $agentId
@return bool
@throws \yii\web\HttpException
778645
public function getMenu($agentId)
    {
        $result = $this->httpGet(self::WECHAT_MENU_GET_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'agentid' => $agentId
        ]);
        return isset($result['menu']['button']) ? $result['menu']['button'] : false;
    }
296635
public function userBlacklistRemove($userId, $blackUserId = array()) {
        try{
            if(empty($userId))
                throw new Exception('用户 Id 不能为空');
            if(empty($blackUserId))
                throw new Exception('被移除的用户 Id 不能为空');

            $params = array(
                'userId' => $userId,
                'blackUserId' => $blackUserId
            );

            $ret = $this->curl('/user/blacklist/remove', $params);
            if(empty($ret))
                throw new Exception('请求失败');
            return $ret;
        }catch (Exception $e) {
            print_r($e->getMessage());
        }

    }
596261
public function deleteTag($tagId)
    {
        $result = $this->httpGet(self::WECHAT_TAG_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'tagid' => $tagId
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
176270
public function deleteCard($cardId)
    {
        $result = $this->wechat->httpPost(self::WECHAT_DELETE_CARD_URL, [
            'card_id' => $cardId
        ], [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok' ? true : false;
    }
1245785
public function getUserInfo($agentId, $code)
    {
        $result = $this->httpGet(self::WECHAT_USER_IFNO_GET_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'code' => $code,
            'agentid' => $agentId
        ]);
        return !isset($result['errcode']) ? $result : false;
    }
288745
public function deleteSendedAll($messageId)
    {
        $result = $this->httpRaw(self::WECHAT_SENDED_ALL_DELETE_PREFIX, [
            'msgid' => $messageId
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok';
    }
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';
    }
747497
public function hasResource($resourceId)
    {
        if (array_key_exists($resourceId, $this->resources)) {
            return true;
        }

        if (!$this->resourceName->isSitesResourceId($resourceId)) {
            return false;
        }

        // @todo this can be made more efficient
        $resource = $this->getResource($resourceId);

        return ($resource !== null);
    }
827755
public function delUserRole($id)
    {
        if (empty($id)) {
            throw new Exception('参数错误');
        }
        $model = new UserRole($this->db);
        if ($model->where('user_id', $id)->delete() === false) {
            throw new Exception('删除用户角色出错');
        }
        return true;
    }
17964
public function set($agentId, $menus)
    {
        $menus = $this->extractMenus($menus);

        $this->http->jsonPost(self::API_CREATE.'?agentid='.$agentId, array('button' => $menus));

        return true;
    }
1062244
public static function exsists($syncid) {
		if (!empty($syncid)) {
			$db = Factory::getDBO();

			$query = $db->getQuery(true)
				->select('syncid')
				->from('#__jfusion_sync')
				->where('syncid = ' . $db->quote($syncid));

			$db->setQuery($query);

			if ($db->loadResult()) {
				return true;
			}
		}
		return false;
	}
653478
private function isValidWebsiteId($websiteId)
    {
        $websites = $this->storeManager->getWebsites();
        if (array_key_exists($websiteId, $websites)) {
            return true;
        }

        if (is_numeric($websiteId)) {
            // Dont bother checking website codes on numeric input
            return false;
        }
        // @todo hs: build up array of websiteCodes, to prevent wasting time looping
        /** @var Website $website */
        foreach ($websites as $website) {
            if ($website->getCode() == $websiteId) {
                return true;
            }
        }

        return false;
    }
393473
public function actionUpdate($id)
    {
        if (request()->post('_asnew') == '1') {
            $model = new User();
        }else{
            $model = $this->findModel($id);
        }

        if (!is_role('admin')) {
            throw new \yii\web\HttpException(403, t('app', 'You are not allowed to perform this action.'));
        }

        if ($model->loadAll(request()->post())) {
            if ($model->saveAll()) {
                set_flash_has_been_saved();
                return $this->redirect(['update', 'id' => $model->id]);
            } else {
                set_flash_has_not_been_saved();
            }
        }

        return $this->render('update', [
            'model' => $model,
        ]);
    }
937906
public function hostDelete($hostId = 0) {
        //设置URL扩展
        $this->setUrlExtend("$hostId");
        //设置请求的方法
        $this->setMethod('DELETE');
        //初始化参数
        $this->initParam();
        //获取返回值
        return $this->response();
    }
150256
public function deleteUser($userId)
    {
        $result = $this->httpGet(self::WECHAT_USER_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'userid' => $userId
        ]);
        return isset($result['errcode']) && ($result['errcode'] ? $this->dump([$result,$this->getAccessToken()]) : !$result['errcode']);
    }
20545
public function stats($type = null, $agentId)
    {
        $response = $this->http->get(self::API_FOREVER_COUNT.'?agentid='.$agentId);

        $response = new Bag($response);

        return $type ? $response->get($type) : $response;
    }
211230
public function deleteMenu($agentid=''){
	    if ($agentid=='') {
	    	$agentid=$this->agentid;
	    }
		if (!$this->access_token && !$this->checkAuth()) return false;
		$result = $this->http_get(self::API_URL_PREFIX.self::MENU_DELETE_URL.'access_token='.$this->access_token.'&agentid='.$agentid);
		if ($result)
		{
			$json = json_decode($result,true);
			if (!$json || !empty($json['errcode'])) {
				$this->errCode = $json['errcode'];
				$this->errMsg = $json['errmsg'];
				return false;
			}
			return true;
		}
		return false;
	}