public function search($params) { $query = Usp::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['Id' => $this->Id, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'status' => $this->status]); $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'IP', $this->IP]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getUsp() { return $this->hasOne(Usp::className(), ['Id' => 'uspId']); }
/** * Finds the Usp model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Usp the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Usp::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getUsp() { return $this->hasMany(Usp::className(), ['Id' => 'uspId'])->via('resMaps'); }