| Conditions | 3 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function search($params) |
||
| 38 | { |
||
| 39 | /* @var $query \yii\db\ActiveQuery */ |
||
| 40 | $class = Yii::$app->getUser()->identityClass ? : 'toir427\admin\models\User'; |
||
| 41 | $query = $class::find(); |
||
| 42 | |||
| 43 | $dataProvider = new ActiveDataProvider([ |
||
| 44 | 'query' => $query, |
||
| 45 | ]); |
||
| 46 | |||
| 47 | $this->load($params); |
||
| 48 | if (!$this->validate()) { |
||
| 49 | $query->where('1=0'); |
||
| 50 | return $dataProvider; |
||
| 51 | } |
||
| 52 | |||
| 53 | $query->andFilterWhere([ |
||
| 54 | 'id' => $this->id, |
||
| 55 | 'status' => $this->status, |
||
| 56 | ]); |
||
| 57 | |||
| 58 | $query->andFilterWhere(['like', 'username', $this->username]) |
||
| 59 | ->andFilterWhere(['like', 'email', $this->email]); |
||
| 60 | |||
| 61 | return $dataProvider; |
||
| 62 | } |
||
| 64 |