获取所有分组
@return bool
@throws \yii\web\HttpException
341821
public function getGroupList()
    {
        $result = $this->wechat->httpGet(self::WECHAT_GROUP_LIST_PREFIX, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['groups_detail'] : false;
    }
1366293
public function parse()
    {
        $bills = [];
        $billTemplate = new Bill(['scenario' => Bill::SCENARIO_CREATE]);

        $lines = explode("\n", $this->data);

        try {
            foreach ($lines as $line) {
                $line = trim($line);
                if ($line === '') {
                    continue;
                }

                $bills[] = $bill = clone $billTemplate;

                list($client, $time, $sum, $currency, $type, $label) = $this->splitLine($line);
                $quantity = 1;
                $bill->setAttributes(compact('client', 'time', 'sum', 'currency', 'type', 'label', 'quantity'));
                $bill->populateRelation('charges', []);
            }

            $this->resolveClients(ArrayHelper::getColumn($bills, 'client'));

            foreach ($bills as $bill) {
                $bill->time = \Yii::$app->formatter->asDatetime($this->resolveTime($bill->time), 'php:d.m.Y H:i:s');
                $bill->type = $this->resolveType($bill->type);
                $bill->client_id = $this->convertClientToId($bill->client);
            }
        } catch (InvalidValueException $e) {
            $this->addError('data', $e->getMessage());

            return false;
        }

        return empty($bills) ? false : $bills;
    }
1019044
public function actionSignup()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['signup']);
        }
        try{
            $model = new SignupForm();
            $model->setAttributes(Yii::$app->request->post());
            $user = $model->signup();
            if ($user !=null) {
                return ["success"=>true,"message"=>"创建成功！"];
            }else{
                return ["success"=>false,"message"=>"参数错误！"];
            }
        }catch(Exception $e){
            throw new Exception($e);
        }



    }
1362126
public function actionThumb()
    {
        if (!Yii::$app->request->isAjax) {
            return $this->redirect(['forum/index']);
        }

        $data = [
            'error' => 1,
            'msg' => Html::tag('span',
                Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                . ' ' . Yii::t('podium/view', 'Error while voting on this post!'),
                ['class' => 'text-danger']
            ),
        ];

        if ($this->module->user->isGuest) {
            $data['msg'] = Html::tag('span',
                Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                . ' ' . Yii::t('podium/view', 'Please sign in to vote on this post'),
                ['class' => 'text-info']
            );
            return Json::encode($data);
        }

        $postId = Yii::$app->request->post('post');
        $thumb = Yii::$app->request->post('thumb');

        if (is_numeric($postId) && $postId > 0 && in_array($thumb, ['up', 'down'])) {
            $post = Post::find()->where(['id' => $postId])->limit(1)->one();
            if ($post) {
                if ($post->thread->locked) {
                    $data['msg'] = Html::tag('span',
                        Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                        . ' ' . Yii::t('podium/view', 'This thread is locked.'),
                        ['class' => 'text-info']
                    );
                    return Json::encode($data);
                }

                if ($post->author_id == User::loggedId()) {
                    $data['msg'] = Html::tag('span',
                        Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                        . ' ' . Yii::t('podium/view', 'You can not vote on your own post!'),
                        ['class' => 'text-info']
                    );
                    return Json::encode($data);
                }

                $count = 0;
                $votes = $this->module->podiumCache->get('user.votes.' . User::loggedId());
                if ($votes !== false) {
                    if ($votes['expire'] < time()) {
                        $votes = false;
                    } elseif ($votes['count'] >= 10) {
                        $data['msg'] = Html::tag('span',
                            Html::tag('span', '', ['class' => 'glyphicon glyphicon-warning-sign'])
                            . ' ' . Yii::t('podium/view', '{max} votes per hour limit reached!', ['max' => 10]),
                            ['class' => 'text-danger']
                        );
                        return Json::encode($data);
                    } else {
                        $count = $votes['count'];
                    }
                }

                if ($post->podiumThumb($thumb == 'up', $count)) {
                    $data = [
                        'error' => 0,
                        'likes' => '+' . $post->likes,
                        'dislikes' => '-' . $post->dislikes,
                        'summ' => $post->likes - $post->dislikes,
                        'msg' => Html::tag('span',
                            Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok-circle'])
                            . ' ' . Yii::t('podium/view', 'Your vote has been saved!'),
                            ['class' => 'text-success']
                        ),
                    ];
                }
            }
        }
        return Json::encode($data);
    }
711211
public function parse()
	{
		while ($this->state && $this->state !== 'emit' && $this->has_data())
		{
			$state = $this->state;
			$this->$state();
		}
		$this->data = '';
		if ($this->state === 'emit' || $this->state === 'body')
		{
			return true;
		}

		$this->http_version = '';
		$this->status_code = '';
		$this->reason = '';
		$this->headers = array();
		$this->body = '';
		return false;
	}
530127
public function run()
    {
        $url = Yii::$app->request->getUrl();

        $out = '';
        switch ($this->what) {
            case 'forum':
                $out .= Yii::t('podium/view', 'Browsing this forum') . ': ';
                break;
            case 'topic':
                $out .= Yii::t('podium/view', 'Reading this thread') . ': ';
                break;
            case 'unread':
                $out .= Yii::t('podium/view', 'Browsing unread threads') . ': ';
                break;
            case 'members':
                $out .= Yii::t('podium/view', 'Browsing the members') . ': ';
                break;
        }

        $out .= $this->getNamedUsersList($url);

        $anonymous = $this->getAnonymousUsers($url);
        if ($anonymous) {
            $out .= Html::button(
                Yii::t('podium/view', '{n, plural, =1{# anonymous user} other{# anonymous users}}', [
                    'n' => $anonymous
                ]),
                ['class' => 'btn btn-xs btn-default disabled']
            ) . ' ';
        }
        $guests = $this->getGuestUsers($url);
        if ($guests) {
            $out .= Html::button(
                Yii::t('podium/view', '{n, plural, =1{# guest} other{# guests}}', [
                    'n' => $guests
                ]),
                ['class' => 'btn btn-xs btn-default disabled']
            );
        }

        return $out;
    }
886736
public function validURLSegment()
    {
        $list = DataList::create(get_class($this->owner))->filter(['URLSegment' => $this->owner->URLSegment]);
        
        if ($id = $this->owner->ID) {
            $list = $list->exclude(['ID' => $id]);
        }
        
        return !$list->exists();
    }
1314768
public function actionAll() {

		Url::remember( Yii::$app->request->getUrl(), 'users' );

		$dataProvider = $this->modelService->getPage();

		$roleMap = $this->roleService->getIdNameMapByType( CoreGlobal::TYPE_SYSTEM );

		$user = Yii::$app->core->getUser();

		if( $user->activeSiteMember->roleId != $this->superRoleId ) {

			unset( $roleMap[ $this->superRoleId ] );
		}

		return $this->render( 'all', [
			'dataProvider' => $dataProvider,
			'roleMap' => $roleMap,
			'statusMap' => User::$statusMap
		]);
	}
108499
public function actionIndex()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['index']);
        }
        try{
            $searchModel = new BizRuleSearch();
            $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());
            //var_dump($dataProvider);die();
            return $dataProvider;
        }catch(Exception $e){
            throw new Exception($e);
        }

    }
782218
public function run()
    {
        $model = $this->model;

        if ($model->delete()) {

            Yii::$app->getSession()->setFlash('success', $this->successMsg);

            Yii::$app->response->format = Response::FORMAT_JSON;
            return [
                'success' => true,
            ];
        }

        Yii::$app->getSession()->setFlash('error', $this->errorMsg);

        Yii::$app->response->format = Response::FORMAT_JSON;
        return [
            'success' => false,
            'error' => print_r($model->getErrors()),
        ];
    }
237518
public function getGroupList()
    {
        $result = $this->httpGet(self::WECHAT_GROUP_LIST_GET_PREFIX, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['groups']) ? $result['groups'] : false;
    }
873520
public function mergeGroupOptions()
    {
        if (!$this->lockOption) {
            $parentOption = $this->parent->getOption();
            // 合并分组参数
            foreach ($this->mergeOptions as $item) {
                if (isset($parentOption[$item]) && isset($this->option[$item])) {
                    $this->option[$item] = array_merge($parentOption[$item], $this->option[$item]);
                }
            }

            $this->option = array_merge($parentOption, $this->option);
            $this->lockOption = true;
        }

        return $this->option;
    }
88508
public function get_all_groups() {
        if ($this->_groups === null) {
            $this->_groups = groups_get_all_groups($this->course->id);
            foreach ($this->_groups as $gid=>$group) {
                $this->_groups[$gid]->name = format_string($group->name);
            }
        }
        return $this->_groups;
    }
1213427
public function actionIndex()
    {
        $models = $this->findInstalledModules();
        $dataProvider = new ArrayDataProvider([
            'allModels' => array_merge(ModuleHelper::findAvailableModules(), $models),
            // TODO 多model排序字段相同的话,会报错 @see https://github.com/yiisoft/yii2/issues/8348
//            'sort' => [
//                'attributes' => ['type'],
//                'defaultOrder' => [
//                    'type' => SORT_DESC
//                ]
//            ]
        ]);

        return $this->render('index', [
            'models' => $models,
            'dataProvider' => $dataProvider,
        ]);
    }
249287
public function parseUrl()
    {
        if (self::PATH_FORMAT === $this->urlFormat) {
            $pathInfo = $this->removeUrlSuffix(Request::httpRequest()->getPathInfo(), $this->urlSuffix);
        } elseif (isset($_GET[$this->routeVar])) {
            $pathInfo = $this->removeUrlSuffix($_GET[$this->routeVar], $this->urlSuffix);
        } elseif (isset($_POST[$this->routeVar])) {
            $pathInfo = $_POST[$this->routeVar];
        } else {
            $pathInfo = '';
        }
        foreach ($this->_rules as $i => $rule) {
            $_pathinfo = $rule->parsePathInfo($this, $pathInfo);
            if (false !== $_pathinfo) {
                return $_pathinfo;
            }
        }
        if ($this->throwNotMatchRule) {
            // 不匹配规则时抛出异常
            throw new Exception(str_cover('"{pathInfo}"找不到对应的URL解析规则，不能确定路由', [
                '{pathInfo}' => $pathInfo,
            ]), 100900101);
        } else {
            // 没有匹配的规则，直接返回pathinfo本身
            return $pathInfo;
        }
    }
64354
public function actionIndex()
    {
        $searchModel = Yii::createObject(AuthenticationSearch::className());
        $dataProvider = $searchModel->search(Yii::$app->request->get());

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }
1149348
public function group()
    {
        $columns = func_get_args();
        $group = '';
        $i = 0;
        //
        if ($columns) {
            foreach ($columns as $value) {
                if (!$i) {
                    $order .= ' group by '.$value;
                } else {
                    $order .= ','.$value;
                }
                $i = 1;
            }
        }
        //
        $this->group = $group;
        //
        return $this;
    }