获取标签成员
@param $tagId
@return bool|mixed
@throws \yii\web\HttpException
182890
public function getTagUserList($tagId)
    {
        $result = $this->httpGet(self::WECHAT_TAG_USER_LIST_GET_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'tagid' => $tagId
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result : $this->dump($result);
    }
1004461
public function tagUser($tagID, $next_openid)
    {
        $params = array(
            "tagid" => $tagID,
            "next_openid" => $next_openid
        );
        $rst = $this->_request->post($this->_url . 'user/tag/get', $params);
        return $this->_client->rst($rst);
    }
163388
public function create($name, $tagId = null)
    {
        $params = [
            'tagname' => $name,
            'tagid'   => $tagId,
        ];

        return $this->parseJSON('json', [self::API_CREATE, $params]);
    }
1068163
private static function setSessionId($sessionId){
        $sessionId = trim($sessionId);

        // 非法字符处理
        if (!$sessionId || preg_match("/[^0-9a-z_\\-\\,]/i", $sessionId)) {
            return false;
        }

        $sessionId = substr($sessionId, 0, 40);
        session_id($sessionId);

        return $sessionId;
    }
182294
public function getTagMembers($tagId, $fetchDetail = false)
    {
        $apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/tag/get';

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

        if ($result and isset($result['userlist']) and isset($result['partylist'])) {
            if ($fetchDetail) {
                $result['userlist'] = array_map(function ($item) {
                    return $this->getUserInfo($item['userid']);
                }, $result['userlist']);
            }

            return ['userlist' => $result['userlist'], 'partylist' => $result['partylist']];
        }

        return null;
    }
871579
public function loadTagInfoByRemoteId($remoteId)
    {
        $row = $this->gateway->getBasicTagDataByRemoteId($remoteId);

        return $this->mapper->createTagInfoFromRow($row);
    }
42029
public function actionCreate($id)
    {
        $parent = $this->findModel($id);
        $model = $this->findModel();
        $model->type = Item::TYPE_ROLE;
        if ($model->load(\Yii::$app->request->post()) && $parent->addChild($model)) {
            Yii::$app->session->setFlash('success', Yii::t('modules/rbac', 'Role saved'));
            return $this->redirect(['update', 'id' => $model->name, 'pid' => $parent->name]);
        }
        return $this->render('form', compact('model'));
    }
773134
public function actionUpdate($id)
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['update']);
        }
        $model = $this->findModel($id);
        try{
            if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) {
                return ['success'=>true,'message'=>'更新成功！'];
            }else{
                return ['success'=>false,'message'=>'更新失败，参数错误'];
            }
        }catch (Exception $e){
            throw new Exception($e);
        }

    }
1285454
public function actionCreate($id)
    {
        $model = new Item();
        $model->pid = $id;
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('modules/page', 'Success'));
            return $this->redirect(['update', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }
1156156
protected function getModuleData($moduleId)
	{
	    $this->module_id = $moduleId; //for RandomBlocker Session
	    //DEBUG log_message('getModuleData Banner Modul ID:'.$moduleId,'Banner.log');
	    $objBannerModule = \Database::getInstance()->prepare("SELECT 
                                                                    banner_hideempty,
                                                        	        banner_firstview,
                                                        	        banner_categories,
                                                        	        banner_template,
                                                        	        banner_redirect,
                                                        	        banner_useragent,
                                                                    cssID,
                                                                    space,
                                                                    headline 
                                                                FROM  
                                                                    tl_module 
                                                                WHERE 
                                                                    id=?
                                                                AND
                                                                    type=?")
											         ->execute($moduleId, 'banner'); 
        if ($objBannerModule->numRows == 0)
        {
            return false;
        }
        $this->banner_hideempty  = $objBannerModule->banner_hideempty;
        $this->banner_firstview  = $objBannerModule->banner_firstview;
        $this->banner_categories = $objBannerModule->banner_categories;
        $this->banner_template   = $objBannerModule->banner_template;
        $this->banner_redirect   = $objBannerModule->banner_redirect;
        $this->banner_useragent  = $objBannerModule->banner_useragent;
        $this->cssID             = $objBannerModule->cssID;
        $this->space             = $objBannerModule->space;
        $this->headline          = $objBannerModule->headline;
        return true;         
	}
922299
public function create(string $tagName, int $tagId = null)
    {
        $params = [
            'tagname' => $tagName,
            'tagid' => $tagId,
        ];

        return $this->httpPostJson('cgi-bin/tag/create', $params);
    }
922760
public function deleteTags($tagId)
    {
        $url = 'https://api.weixin.qq.com/cgi-bin/tags/delete?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['tag' => ['id' => $tagId]]);
    }
1028766
public QYResultType delete(Integer tagid){
        BeanUtil.requireNonNull(tagid, "tagid不能为空！");
        String url = BASE_API_URL + "cgi-bin/tag/delete?access_token=#&tagid=" + tagid;
        BaseResponse response = executeGet(url);
        return QYResultType.get(response.getErrcode());
    }
113845
public function actionItems($nodeId)
    {
        UserOnline::unlock(Yii::$app->adminuser->id);
        return Yii::$app->adminmenu->getModuleItems($nodeId);
    }
724352
public function createFromArray( $parentId, $parentType, $tags ) {

		foreach( $tags as $tagName ) {

			$tagName = trim( $tagName );

			if( empty( $tagName ) ) {

				continue;
			}

			$tag = $this->tagService->getFirstByNameType( $tagName, $parentType );

			if( !isset( $tag ) ) {

				$tag = $this->tagService->createByParams( [ 'siteId' => Yii::$app->core->siteId, 'name' => ucfirst( $tagName ), 'type' => $parentType ] );
			}

			$modelTag = $this->getFirstByParentModelId( $parentId, $parentType, $tag->id );

			// Create if does not exist
			if( empty( $modelTag ) ) {

				$this->createByParams( [ 'modelId' => $tag->id, 'parentId' => $parentId, 'parentType' => $parentType, 'order' => 0, 'active' => true ] );
			}
			// Activate if already exist
			else {

				$this->activate( $modelTag );
			}
		}
	}
389131
public function getProduct($productId)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_PRODUCT_GET_PREFIX, [
            'product_id' => $productId
        ], [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['product_info'] : false;
    }
590742
public function openWebById($webId)
    {
        $web = new Web($this->getContext(),$this->getResourcePath());
        $qry = new InvokePostMethodQuery($this->getResourcePath(),"openWebById",array($webId));
        $this->getContext()->addQuery($qry,$web);
        return $web;
    }