with(['name', 'group']) ->where(['not', ['uid' => 1]]); $dataProvider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ 'pageSize' => 25, ], ]); $this->load($params); if (!$this->validate()) { // $query->where('0=1'); return $dataProvider; } if ($this->from) { if ($this->from == 'backend') { $query->andWhere('bind_uid is null'); } else if ($this->from == 'fxee') { $query->andWhere('bind_uid is not null'); } } return $dataProvider; } }